Yes, `cfunc` is in reality a C function from an external library that I want to
wrap that does something completely different.
I think his `cfunc` there was just a dummy to test with, not what he actually
wanted to do. But otherwise it would be possible to do it like you do.
As a practice is good, but you can even use templates:
template wrapper(arg: varargs[untyped]): string =
var h, t = ""
for f in fields((arg)):
when f is string: (h &= "s";t &= f;)
elif f is int:(h &= "i"; t &= $f;)
(h & t)
# "tests"
I second this, `quote` is just one tool, not something you need to or have to
use.
This looks good! I'm pretty sure using `quote` wouldn't really improve it.
So I'm trying to learn macros, and its not easy if you've never done
metaprogramming. Anyway, I'm trying to write a wrapper for a C function that
takes a variable number of arguments, with the first being a string that
specifies the types of the rest. I want the wrapper to create this string
au