3 ms·
To debug macros in Nim, you'll likely need to print arguments and expansions at compile-time, inspect the output, change things to see what happens, repeat...
by michaelsbradley 2y ago
To debug macros in Nim, you'll likely need to print arguments and expansions at compile-time, inspect the output, change things to see what happens, repeat...
https://nim-lang.org/docs/macros.html#toStrLit%2CNimNode https://nim-lang.org/docs/macros.html#toStrLit%2CNimNode
https://nim-lang.org/docs/macros.html#astGenRepr%2CNimNode https://nim-lang.org/docs/macros.html#astGenRepr%2CNimNode
https://nim-lang.org/docs/macros.html#dumpAstGen.m%2Cuntyped https://nim-lang.org/docs/macros.html#dumpAstGen.m%2Cuntyped
https://nim-lang.org/docs/macros.html#treeRepr%2CNimNode https://nim-lang.org/docs/macros.html#treeRepr%2CNimNode
https://nim-lang.org/docs/macros.html#dumpTree.m%2Cuntyped https://nim-lang.org/docs/macros.html#dumpTree.m%2Cuntyped
https://orlybooks.com/books/changing-stuff-and-seeing https://orlybooks.com/books/changing-stuff-and-seeing