small template and mixin frustration...

sigod via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jun 6 13:23:00 PDT 2015


On Saturday, 6 June 2015 at 19:42:41 UTC, WhatMeWorry wrote:
> Trying to create the following statement programatically:
>
> writeln(__traits(identifier, someSymbol), " = ", someSymbol);
>
>
> GLfloat[6] staticVerts = [0.0, 1.0,-1.0, -1.0, 1.0, -1.0];
> int i = 7;
>
> mixin (myDebug("staticVerts"));  // This one works with output 
> following
> mixin (myDebug("i"));            // This one works with output 
> following
>
> staticVerts = [0, 1, -1, -1, 1, -1]
> i = 7

Why are you trying to use `mixin` while you can just call 
function?

E.g.
```
GLfloat[6] staticVerts = [0.0, 1.0,-1.0, -1.0, 1.0, -1.0];
int i = 7;

log(staticVerts);
log(i);
```

(`log` is just an example.)


More information about the Digitalmars-d-learn mailing list