3 ms·
The macro example used is meant to be instructive, not a demonstration of how powerful macros could be. Consider https://gist.github.com/1119534 https://gist.g
by prospero 15y ago
The macro example used is meant to be instructive, not a demonstration of how powerful macros could be.
Consider https://gist.github.com/1119534 https://gist.github.com/1119534, which demonstrates a pattern-matching syntax that (at compile-time!) constructs a minimal traversal of the data structure to find a match. The only way to do this in a language without macros is to write your own compiler.
- copper 15y agoOr Shriram Krishnamurthi's Automata via Macros - a beautiful little nontrivial example of Scheme macros: http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/ http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk...