4 ms·
> It's really hard to come up with an actual macro use case that is not covered by modern Python and is still actually a good idea. sqlalchemy (and now mongoal
by jfm3 16y ago
> It's really hard to come up with an actual macro use case that is not covered by modern Python and is still actually a good idea.
sqlalchemy (and now mongoalchemy) is begging for macros. See CLSQL for an answer.
Regular expressions are infinitely more readable as expressions in a dynamic syntax. See the rx package in Emacs for starters.
What if you want shell/Ruby style back quotes, which in essence create a closure that runs a batch job? See my SHELLSHOCK library (jfm3.org) for the Common Lisp extension. It's not much code at all.
What if you want large literal strings which respect the indentation of their surrounding code, without uglying things up with <<<EOF ? See my BOXEN library (also jfm3.org) for that Common Lisp extension.
What if you want something like Python's r"string", but you want more control over which things are escaped and which are not? See CL-INTERPOL for that.
What if you want anaphora in your control structures?
What if you want Lex/Yacc style parser generator specifications where the type of productions is extensible, and the productions themselves can be generated dynamically at compile time? (This will make no sense to you unless you've ever had no choice but to run m4 on your .l and .y files.)
I could go on. It's not hard for me.