3 ms·
Could you expand on the lack of hygiene? I know Nim has hygienic templates by default, with an opt for 'injecting' variables into the enclosing scope (which co
by perturbation 10y ago
Could you expand on the lack of hygiene? I know Nim has hygienic templates by default, with an opt for 'injecting' variables into the enclosing scope (which comes in handy when (for example) you have a DSL for parsing command line options like the docopt.nim or commandeer packages).
If you mean that whatever AST is generated by calling macro gets put in the enclosing scope - then yes, AFAIK you're right, but this can be fixed by wrapping a macro in a proc (function).
I'll agree that forward declaration is really clumsy, I hope that that is fixed before 1.0.
- qwertyuiop924 10y agoI meant that ASTs were non-hygenic, with all the problems therein, and nary a gensym to be seem, AFAICT. That's pretty bad. I also fail to see how wrapping a macro in a proc would help, unless you mean the call to the macro at the expansion site, which is a pretty clumsy thing to do, and actually doesn't fix most of the problems.
- dom96 10y ago> ... and nary a gensym to be seem ... You mean this? http://nim-lang.org/docs/macros.html#genSym,NimSymKind,string http://nim-lang.org/docs/macros.html#genSym,NimSymKind,strin...
- qwertyuiop924 10y agoAh, there it is. Thanks. That makes things a little bit better, but still.