[plt-scheme] Question on Syntactic Sugar

From: Dave Herman (dherman at ccs.neu.edu)
Date: Thu Nov 1 15:34:09 EDT 2007

Would this get the job done?

(define-syntax setq
   (syntax-rules setq
     [(setq rest ...) (define rest ...)]))


J.T. Hurley wrote:
> I've been working on an "overlay" for Scheme that would let a user
> enter a set of extremely dated pseudo-lisp from a puzzle book as
> Scheme code in MzScheme.
> For the most part, this has been trivially easy, just using (define
> old-term new-term). However, I've hit a huge snag.
> The old pseudo-lisp uses setq instead of define, and MzScheme throws
> an error if you use define within in a definition. What would be the
> easiest way to get around this and create an expression equivalent to
> (define setq define)?
> Thank you in advance,
> J.T.
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.