[Top][All Lists]

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

Re: Patch to add (define-syntax (foo bar) ...) support

From: Andy Wingo
Subject: Re: Patch to add (define-syntax (foo bar) ...) support
Date: Fri, 02 Sep 2011 10:32:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)


On Sun 03 Jul 2011 22:19, "Chris K. Jester-Young" <address@hidden> writes:

> When writing syntax-case macros, often one would write:
>     (define-syntax foo
>       (lambda (bar)
>         (syntax-case bar ...)))
> This seems overly long-winded; it would be preferable to be able to
> write, instead:
>     (define-syntax (foo bar)
>       (syntax-case bar ...))

I am not sure what I think about this.  On the one hand it elides things
that you type all the time.  On the other hand sometimes I think it
obscures the fact that there is a lambda there; I'm used to having

  (define (foo bar) ...)

mentally indicate "procedure", but

  (define-syntax (foo bar) ...)

doesn't mentally indicate that for me, in part because it's explicitly
in the domain of macros, where we have to think about what we're
parsing.  For example, we are trained now to consider syntax-rules to be
a language that looks like scheme but it not scheme.  Without the
lambda, would people have trouble identifying a procedural macro as
being Scheme?

On the whole I am skeptical.  But, Chez Scheme and Racket both made this
change.  So I could go either way, though I would like thoughts from
other people before proceeding.

On the other hand, one thing that is clearly useful is
`define-syntax-rule'.  I'll add that now.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]