[plt-scheme] redefining primitive syntax

From: Doug Orleans (dougo at ccs.neu.edu)
Date: Wed Jul 16 13:28:17 EDT 2003

Matthew Flatt writes:
 > > Is there some easy way to do what I want?  I would be happy with a
 > > function from syntax objects to syntax objects that replaced all
 > > occurences of `let-values' with the appropriate `lambda' expressions;
 > > the only way I can think of to do this is to structurally recurse on
 > > the result of `expand', using a big `syntax-case' for all the
 > > primitive syntax forms, but this is a little tedious.
 > 
 > That's the only approach I can recommend.

OK.  That's how I do free-variable analysis already.  It just felt
like in this case that I was doing something very much like what the
expander already does, so I thought I should be able to reuse its code
somehow.

 > The "kerncase.ss" module of "syntax" may help a little.

Thanks-- I don't know why I didn't look at the "syntax" collection
before!  Looks like "boundmap.ss" might be useful for my free-variable 
stuff too.  Why is `kernel-form-identifier-list' different from the
list used in `kernel-syntax-case'?

--dougo at ccs.neu.edu



Posted on the users mailing list.