[plt-scheme] macro expension order

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Mon Jul 9 21:52:09 EDT 2007

Yes. I'm thinking the same thing after your first reply (and with more 
tests about define-match-expander). Thanks.

p.s. I send you a E-mail a couple of days ago. Have you get it?


Matthew Flatt wrote:
> Ah -- your goal is much clearer now. 
> I think you probably want to expand `id' in a pattern to something like
> `(ML-pattern-id id)'. Then define `ML-pattern-id' as a match expander
> that checks the binding of `id'; if it's bound as a struct type, then
> expand to a suitable structure pattern, otherwise expand to just `id'.
> Or something like that. The key point is that you can pick what an
> identifier means in a match pattern by wrapping it with a form that you
> control (as a match expander).
> Matthew

Posted on the users mailing list.