script(type="text/javascript")
|var x = 0
- foreach(x; things)
| #{x}, // <-- it can't find x
|];
Problem:
Error: undefined identifier x, did you mean template to(T)?
It seems that the scope of the '|' block under the foreach isn't scoped correctly, x is not local...?
You know, I reckon there's a possible library function here. What I need to do is make some D data available to the javascript.
It would be awesome to have a function which would produce a javascript declaration from a D value/structure.