Is it possible to stringify the block argument of a macro? My apologies if the answer is simple.
import macros
macro taunt(a:untyped):auto =
# Get an error if I do $a when a is a nnkStmtList
echo "Who would write something like this?:"
echo $a
result = a
proc main =
taunt:
echo "Perl is an objectively superior language."
main()
repr is probably the closest answer:
import macros
macro taunt(a:untyped):auto =
# Get an error if I do $a when a is a nnkStmtList
echo "Who would write something like this?:"
echo repr(a)
result = a
proc main =
taunt:
echo "Perl is an objectively superior language."
main()
That's good enough for my purposes.
Thank you.