3 ms·
I still use `syntax-rules` a lot for simple macros - there's hardly any boilerplate and macros come out very readable without all the quasi-quoting, quasi-unquo
by widdershins 7y ago
I still use `syntax-rules` a lot for simple macros - there's hardly any boilerplate and macros come out very readable without all the quasi-quoting, quasi-unquoting etc. that happens in other macro systems.
But some things just can't be accomplished with it. I only turn to `syntax-case` for these things, like introducing new identifiers, or fully procedural tasks. It blew my mind when I discovered that I could write a macro that actually reads files from disk and binds variables to each path at macro-expansion time (not saying that's a great idea though...)
- neilv 7y agoI like `syntax-rules` and have done some crazy things with it. If I were going to teach someone syntax extension in Scheme or Racket, however, I'd just use `syntax-case` or `syntax-parse` for everything. That avoids confusing people with two different languages.