3 ms·
> Syntax extensions are not for trivial rewriting, that's the purpose of macros. Syntax extensions are for doing things like expanding a regex into a finite sta
by progman 11y ago
> Syntax extensions are not for trivial rewriting, that's the purpose of macros. Syntax extensions are for doing things like expanding a regex into a finite state machine at compile-time.
Nim provides templates and macros for that. Templates are for rewriting while macros can create arbitrary AST nodes.
http://blog.ldlework.com/2015/05/01/a-cursory-look-at-meta-programming-in-nim/ http://blog.ldlework.com/2015/05/01/a-cursory-look-at-meta-p...