|
|
|
|
|
by flyx86
3552 days ago
|
|
Now see, that's much clearer. From the perspective of someone who knows Lisp, perhaps. I find it very confusing. Moreover, you are using an example from a tutorial, which is meant to explain how things work, not to show what the best way to write some macro is. You can write the same macro with less verbosity: macro debug(n: varargs[typed]): typed =
result = newNimNode(nnkStmtList, n)
for x in n:
let xRepr = toStrLit(x)
result.add(quote do: writeLine(stdout, `xRepr` & ": " & $`x`))
|
|