4 ms·
It's like you didn't read the previous poster: They're claiming lisp macros can work BEFORE the compiler generates an AST.
by ori_b 6y ago
It's like you didn't read the previous poster: They're claiming lisp macros can work BEFORE the compiler generates an AST.
- TylerE 6y agoYes, it's the same in nim. For instance, see this example which defines a compact definition syntax that is certainly not valid vanilla nim: https://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html https://peterme.net/metaprogramming-and-read-and-maintainabi... Refer to lines 63-88 of the large final example.
- ori_b 6y agoAnd if I wanted to make 'for' into a valid variable name, or change the tokens for specifying numbers, for example, how would I go about doing that?
- junke 6y agoOk this is nice but you this would be rougly the same in Lisp, apart from AST constructors ("newIdentNode()",...), which would simply be backquote/unquote. Plus you have to write enumInfo[0], enumInfo[1] instead of pattern matching.