Closed emlyn closed 6 years ago
That is expected, istr
is a macro and it evaluates the string interpolation on the compilation time.
Yeah, it's a shame though, it would be handy if it worked.
Seems like this is not a cuerdas
problem, because is the clojure parser that does not detects the %
inside string. Let see some code:
user=> (macroexpand '#(istr "n=~{%}"))
(fn* [] (istr "n=~{%}"))
user=> (macroexpand '#(istr "n=~{%}" %))
(fn* [p1__1418#] (istr "n=~{%}" p1__1418#))
You can see that if you use the %
only inside the string, the expanded reader macro is results in a function with no argument.
E.g.:
This seems to be because the
#()
form is expanded beforeistr
, so it doesn't see the%
inside the string and therefore doesn't convert it to the mangled form. Unfortunately I'm not sure there's much that can be done to fix this.