Open masak opened 5 years ago
Linking http://www.willdonnelly.net/blog/scheme-syntax-rules/ here.
I notice that I've let this issue get a month old without having a proper OP description. Anyway, tl;dr: I was quite taken with Dylan's pattern macros. What we're doing, Dylan calls "procedural macros", and it never got them, preferring instead the pattern macros (which it calls just "macros").
Two challenges arise. The first one is that the patterns work on the lexical level, and a sequence of patterns in a macro are conceptually tried in order. It's hard to see how this wouldn't constitute re-parsing.
The second one is hygiene. Dylan manages this, though, and I think 007 could as well. But it needs more design.
Looking at the source code of the SweetJS module matches.js, it seems like it does what a macro would do: generate code (well, there as a string), and create a new Function
with the source code.
tbd