[plt-scheme] macro expension order

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

Matthew Flatt wrote:
> At Mon, 09 Jul 2007 17:21:28 -0600, Chongkai Zhu wrote:
>   
>> So here I would like to ask: what is the correct way to "define" 
>> something that will apply before the match library see the pattern? 
>>     
>
> Is `define-match-expander' what you're looking for? It allows you to
> extend the syntax of patterns (which are not expressions, and so macro
> bindings don't have any effect on them).
>
> Matthew
>
>   
Seems no. I have noticed `define-match-expander' before sending out the 
previous E-mail. It only works when I want "id" as a expander as
pat ::= ...
  |  (id XXX)

But here what I want is actually a conflict case of

pat     ::= identifier [not ooo]              Match anything, bind 
identifier as a variable

Or, if "identifier" is "NONE" then it is symbol "NONE", otherwise it is 
an  identifier.

Chongkai




Posted on the users mailing list.