[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] [wg2] in support of single-arity procedural syntax transformers

On 05/11/11 17:06, Andy Wingo wrote:
> On Wed 11 May 2011 17:25, Peter Bex <Peter.Bex@x> writes:
>> The procedures or syntactic forms er-macro-transformer,
>> sc-macro-transformer, syntax-case and syntax-rules already
>> hide the implementation details well enough.
> That is true for all but syntax-case.  In fact syntax-case is not an
> expander at all: it is a helper to destructure and build syntax objects.
> It is an expression, something that can occur where other Scheme code
> can occur.  You might decide that you don't like it, and that's cool, no
> need to implement it.

Aye, that's one thing I don't like about the "syntax-case macro system"
as a whole; it tries to steal the top slot! I'd be all for it if it came
with a wrapper (which needn't be called syntax-case, as as you say,
that's just a part of the 'system') to decouple it from define-syntax.

> But for WG2 to *allow* user-provided destructuring and building forms,
> like syntax-case, one needs to specify the type of syntax transformers
> themselves, and provide the most basic accessors for syntax objects.

Not so!

(define-syntax foo (syntax-transformer (lambda (stx) ...(syntax-case

It's not syntactically compatible with "the syntax-case macro system",
but it's only a simple wrapper away, and it avoids overspecifying what
define-syntax binds.

> Andy


Alaric Snell-Pym

Scheme-reports mailing list