[gambit-list] Meroon and syntax-case?

Bradley Lucier lucier at math.purdue.edu
Thu Mar 22 14:06:26 EDT 2007


On Mar 22, 2007, at 12:59 PM, Phil Dawes wrote:

>
> Marc Feeley wrote:
>>
>>> Has anybody attempted to build a meroon style system using syntax- 
>>> case
>>> macros? Any pointers would be much appreciated.
>>
>> Have you considered implementing define-macro on top of syntax-case?
>> I'm not sure how much mileage you can get out of it, but here's  
>> one way
>> of defining define-macro:
>>
>> [...]
>
> Blimey - that works a treat. Thanks a lot!

There are several serious advantages to adapting the Meroon macros to  
use syntax-case directly:

1.  In the past, when given incorrect syntax for Meroon forms, for  
define-class, say, the macro-expanders have crashed.  This is very  
difficult to debug, and eventually led me to compile those files in  
(safe) mode rather than (not safe) mode.  Even then, debugging  
crashes in macro expansion is no treat.

2.  The Meroon code for "with-access" is bogus.  To do this with  
define-macro, you need a code-walker, which Meroon does not have, and  
which syntax-case, because of its automatic renaming of variables in  
different contexts, has more-or-less by default.  The with-access  
code in Meroon can easily be "fooled" to give totally bogus results.

So I'm still interested if someone wants to rewrite the Meroon macros  
using syntax-case.

Brad



More information about the Gambit-list mailing list