On Thu, 21 Nov 2013 15:26:16 GMT, Manu Evans wrote:
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.
Actually, as far as I can tell, all the '|' beneath script are ignored.
So just the same as :javascript, everything beneath script() seems to be copied verbatim as well.