[plt-scheme] Re: misplaced ellipses

From: David Van Horn (dvanhorn at cs.brandeis.edu)
Date: Tue Feb 26 17:54:28 EST 2008

Matthew Flatt wrote:
> The quoting action of the `...' happens in the `syntax-rules' template,
> though. As a template, within the `syntax-rules' form,
> 
>  (syntax (... id))
> 
> is the same as
> 
>  (syntax id)
> 
> because the `...' quotes `id' (which doesn't actually need it).
> 
> Since you want two levels of `syntax' quoting, you need two levels of
> `...' quoting within the `syntax-rules' form:
> 
>   (syntax ((... ...) id))
>             ^^^ ^^^------- quotes `id' in the expansion
>              `-------quotes the `...' that comes next
> 
> or, equivalently and maybe easier to read:
> 
>   (... (syntax (... id)))
>    ^^^          ^^^------- quotes `id' in the expansion
>      `-------quotes the `...' later

Matthew, thanks, this explanation really helped.  Ryan, you read my 
mind: I was actually trying to write a macro for explicitly overriding 
the implicit unquoting of pattern variables in a `syntax' form.

David



Posted on the users mailing list.