[plt-scheme] Attaching compile time information to identifiers

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sun Oct 29 15:31:10 EST 2006

David Van Horn skrev:
> I'd like to write two macros, f & g, with the following usage:
> (f id e ...)
> (g id)
> Such that for the same identifier id, g knows (during expansion) how 
> many e's were given in (f id e ...), ie. I'd like f to attach some 
> information to id that g can subsequently look up.  How can I do this?

Start with these slides


and then go on to the paper:

   "Composable and Compilable Macros - You Want it When?".
   Matthew Flatt, ICFP 2002

My attempt at explaining the concepts via a simpler example
than the record one is found in the attached note. The exact
same technique can be used for your macros.

Simply cut and paste all modules into the definition window
and hit run.

Jens Axel Søgaard
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: macros-and-modules-version-3.txt
URL: <http://lists.racket-lang.org/users/archive/attachments/20061029/19c40624/attachment.txt>

Posted on the users mailing list.