Closed
Description
It's currently very hard to use strformat module in a quote do section
Here is the ideal way to use it that does not work
import macros, strformat
macro foo(): untyped =
result = quote do:
let bar = "Hello, World"
echo &"Let's interpolate {bar} in the string"
foo()
Here is the current way to make it work:
import macros, strformat
macro foo(): untyped =
let workaround = newIdentNode("workaround")
result = quote do:
let `workaround` = "Hello, World"
echo &"Let's interpolate {workaround} in the string"
foo()