[plt-scheme] How to create a macro that's in expression position?

From: Agnes Schemelt (highflyer451 at hotmail.com)
Date: Mon Mar 31 00:33:22 EST 2003

Hi.

Reading through the MzScheme language manual, I found in chapter 12 a 
statement that says you can create macros that are in expression position. I 
take this to mean that, for example, a macro TRIGGER can be invoked with 
this code:
         ( 1  TRIGGER 4 )

What does the macro definition look like?

The best I could come up with is this, which doesn't work:
   (define-syntax (TRIGGER stx)
      (syntax-case stx ()
         (( x TRIGGER y) ...etc..)
       )
    )

What's weird is that if you could get it to work, the syntax object for a 
macro in expression position is not (identifier ...) but only the identifier 
itself, which doesn't seem useful. How do you get the rest?

It would be wonderful if it truly worked. And I have a suspicion
that this is what's behind the infix syntax:
         (if (a . < . b) ..etc..)

Can anyone help? Thanks.

---- Agnes

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail



Posted on the users mailing list.