[plt-scheme] Defining syntax parameters that act like ordinary symbols outside of syntax-parameterize

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Sun Feb 21 16:57:23 EST 2010

Remco Bras wrote:
> Hi,
> I'm using quite a few macros that use syntax parameters, so I'd like
> them to act like ordinary symbols (when not in syntax-parameterize)
> to not clutter up the namespace too much. 

What do you mean by "act like ordinary symbols"? Do you have some examples?

And what do you mean by "clutter up the namespace"? The way syntax 
parameters work is they reserve a name so that macros like your 
'alambda' macro can communicate with references. Once you define a 
syntax parameter, it means *something* everywhere that it's in scope. If 
it's not supposed to be used outside of certain contexts, then it should 
raise a specific error message that says so. Why should it pretend to be 
something else? (An unbound variable?)


I wrote an attempt (see
> below) to alpha-rename the parameters to gensyms outside of
> syntax-parameterize.
> Could someone tell me if this will work properly? So far, I haven't
> found a way to break it.
> (define-syntax-parameter foo (let ((sym (gensym))) 
> (make-rename-transformer (datum->syntax #f sym))))
> -Remco _________________________________________________ For
> list-related administrative tasks: 
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.