Re: Confusion about macros.

2018-09-26 Thread solo989
Thanks for the help. I didn't quite get what the not unused error was because it was so short and I was hung up on the other error.

Re: Confusion about macros.

2018-09-26 Thread gemath
This works: macro t2(): untyped = result = getAst(t1()) #t2() Run A macro produces an abstract syntax tree (AST) of nodes, that's what is assigned to its `result` variable. A macro call like `t1()` is replaced with the code representation of this AST,

Confusion about macros.

2018-09-25 Thread solo989
This works. import macros import typetraits macro t1() : untyped = return nnkStmtList.newTree( nnkDiscardStmt.newTree( newEmptyNode() ) ) t1() Run But if I add: macro t2(): untyped =