Re: template - body issue
Use `expandMacros`, like below: import macros template tpl(name: untyped, body: untyped): untyped = proc `name Free`()= body expandMacros: tpl(myname): echo "1" echo "2" mynameFree() Run
Re: template - body issue
One remaning question is how can I see the result from a template execution. I am not talking about invoking the template. For instance in the example above, is there a way to see how: tpl(myname): echo "1" echo "2" Run gets converted into: proc mynameFree() = echo "1" echo "2" Run
Re: template - body issue
instead of a string use untyped, i.e. template tpl(name:untyped, body:untyped):untyped = proc `name Free`()= body tpl(myname): echo "1" echo "2" mynameFree() Run