On Friday, 9 February 2018 at 21:31:29 UTC, ShadoLight wrote:
[1] https://run.dlang.io/is/dyElXg


There's missing quotes in there:

Line 14:
code ~= "push(call!"~piece~"(pop(), pop()));\n";

Should be:

code ~= "push(call!\""~piece~"\"(pop(), pop()));\n";


That might have been an error in the original book. A lot of quotes and semicolons got mangled in the process of copying them from the actual compilable examples into the MS Word manuscript..

But to explain why this is wrong just consider the code generated:

push(call!+(pop(), pop()));


When the operator is pasted in without quotes, you get the above. And + isn't a valid template arg. But "+" is.

Reply via email to