If I write a macro as such:
macro `@@@`(x: typed): FancyType =
# stuff goes here
var a = @@@{"fromStruct": "blah", "sub": {"joe": 10}}
Run
All is good.
Or if I do:
macro `@@@`(x: Blork): FancyType =
# stuff goes here
let xyz = Blork()
var a = @@@xyz
Run
All is still good.
But if I do both, then one macro overwrites the other.
Okay, no problem. I'll make the first one have a specific type for that
curly-bracket-thing to separate it from the other. I can't see to find the name
for it though. Reverse engineering implies the type is determined on a
case-by-case basis during compile-time. Makes sense. Looking at `json` example
of %*. Yep, uses NimNode generically. Drat.
But, I'll ask anyway: is there a way to "declare" that one version of the macro
is expecting the curly-bracket-thing.
Also..is there an official name for
the...curly-bracket-looks-like-json-but-isn't-thing? Giving me a name will help
with further communication. :)