[plt-scheme] Reproviding "else"

From: Neil Toronto (ntoronto at cs.byu.edu)
Date: Mon Mar 16 15:19:48 EDT 2009

The attached example language module "cond-lang.ss" implements a very 
small language, reproviding a few bits of Scheme and providing a new 
cond macro. When "cond-test.ss" uses that macro, the compiler gives an 
error:

     compile: unbound identifier (and no #%top syntax transformer
     is bound) in: else

It's not just else, though: you can't use as a literal any name that's 
in scope in the macro definition. (For example, the compiler gives the 
same error if else is changed to foobar and foobar is defined at the top 
level.) Well, you can, but you have to provide that name as well as the 
macro. If you can't safely do that, there are uglier ways.

Why are literals with syntax properties used for matching?

Neil

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cond-lang.ss
URL: <http://lists.racket-lang.org/users/archive/attachments/20090316/b348b1d3/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cond-test.ss
URL: <http://lists.racket-lang.org/users/archive/attachments/20090316/b348b1d3/attachment-0001.ksh>

Posted on the users mailing list.