From: Noah Lavine <noah.b.lavine@gmail.com>
To: guile-devel@gnu.org
Subject: Re: Patch to add (define-syntax (foo bar) ...) support
Date: Sun, 3 Jul 2011 16:44:46 -0400 [thread overview]
Message-ID: <CA+U71=P-pvqqRqXkbSykHqP7cG8wFVbkVPyGQsS8zeKDt_BCsw@mail.gmail.com> (raw)
In-Reply-To: <20110703201942.GA23510@yarrow.destinee.acro.gen.nz>
Hello,
I agree that this is much shorter, but I'm worried about defining the
short syntax in a way that forces you to choose between syntax-rules
and syntax-case. What I mean is that you could just as easily have
(define-syntax (foo bar)
...)
expand to
(define-syntax foo
(syntax-rules ()
((_ bar) ...)))
It seems to me that this makes a somewhat arbitrary choice, which
isn't great. I'd rather see some way to unify the two possibilities,
but I don't know what that would be. There's also the possibility of
making it expand to
(define-syntax foo
(syntax-case tmp ...
((bar) ...)))
because it is more analogous to how regular procedures work.
I don't know what the right choice is, but it's a good point that
there probably should be something.
Noah
On Sun, Jul 3, 2011 at 4:19 PM, Chris K. Jester-Young <cky944@gmail.com> wrote:
> Hi there,
>
> 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 ...))
>
> Attached is a patch that implements that. Note that there is nothing
> original in this patch---it's just a straight copy-and-paste of the
> "define" version immediately above, except changing define-form to
> define-syntax-form---so there should be nothing controversial from a
> correctness and/or copyright point of view.
>
> Let me know what you think.
>
> Many thanks,
> Chris.
>
next prev parent reply other threads:[~2011-07-03 20:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-03 20:19 Patch to add (define-syntax (foo bar) ...) support Chris K. Jester-Young
2011-07-03 20:44 ` Noah Lavine [this message]
2011-07-03 21:03 ` Chris K. Jester-Young
2011-07-03 21:08 ` Noah Lavine
2011-07-03 22:34 ` Ian Price
2011-09-02 8:32 ` Andy Wingo
2011-09-02 13:33 ` Ian Price
2011-09-02 16:53 ` Andy Wingo
2011-09-05 7:58 ` Marijn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+U71=P-pvqqRqXkbSykHqP7cG8wFVbkVPyGQsS8zeKDt_BCsw@mail.gmail.com' \
--to=noah.b.lavine@gmail.com \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).