Monday, February 14, 2005

Macros that paint

Aha! I'm starting to have a clue what Ryan has been talking about all these years with "painting" and macro expansion. In Macros that Work, every renaming that happens in a particular transcription is distinct; there aren't any relationships between renamings of different identifiers in a single transcription.

But in Dybvig et al, the programmed macro system has library procedures that allow the programmer to apply the renamings that were used for one identifier to another one, so that you can say things like "this occurrence of x is the same as that occurrence of x." Furthermore, all the identifiers in a single transcription step get the same renaming applied to them, so that you can say "this occurrence of x has the same renaming as that step." In certain cases this allows you to say "this x is the same as that x" without actually pointing to the particular occurrence of x; you only need any syntax object from the same transcription step. Not a particularly abstract facility! Yikes.

I think it's time I read about syntax-case.

No comments: