[plt-scheme] macro keyword conflicting with other imports?

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed Nov 10 18:04:54 EST 2004

At Wed, 10 Nov 2004 16:56:48 -0600, ian barland (penguin flight instructor) wrote:
> Matthias writes:
> > 
> > Export fun as a keyword that blows up when used in an improper context. 
> > 
> Not sure if this is what you meant, but:
> I made `fun' a syntax-id-rules with no clauses, so it always blows up,

To be a little bit better with the errors, you can even do this:

  (define-syntax (fun stx) 
    (raise-syntax-error 'fun "can only be used inside ..." stx))

> except when it occurs inside the intended macro which preemptively
> transforms it away.

Exactly.

> ...Still, seems like an awfully odd contortion!

AKA, a macro design pattern :)

Robby


Posted on the users mailing list.