syntax-parse

13 views
Skip to first unread message

Arthur A. Gleckler

unread,
Sep 5, 2021, 1:45:51 PM9/5/21
to scheme-re...@googlegroups.com
There has been a lot of talk about supporting syntax-case in R7RS Large, but I wonder whether it might be worth considering syntax-parse instead.  The Racket folks seem to be in strong agreement that it's better than syntax-case.  I have no experience with either, but it seems a shame not to consider it when many experienced macro writers have converged upon it after having worked with both.

Here's a tutorial:

Marc Nieper-Wißkirchen

unread,
Sep 5, 2021, 2:06:29 PM9/5/21
to scheme-re...@googlegroups.com
I think we mustn't confuse syntax-case with syntax-case (sic!).

One is a syntactic form used to destructure syntax objects, the other is a procedural macro system.

What syntax is offered to destructure syntax objects is a comparably minor decision.  When we have talked about supporting syntax-case in R7RS-large, we have mostly talked about the other meaning of syntax-case.

Now about the destructuring syntactic forms:

Syntax-parse is much more complicated to specify than syntax-case and needs a lot of other syntactic machinery of Racket (Racket-style keywords, for example).  Thus, if the macro system "syntax-case" is voted in, it will still make sense to offer the syntactic form syntax-case first (also for compatibility with existing implementations).  Then one can take one's time to see whether a more complicated but also more sophisticated matcher should be added as well.  (Personally, I would prefer the simplicity of syntax-rules/syntax-case.)

Marc

--
You received this message because you are subscribed to the Google Groups "scheme-reports-wg2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scheme-reports-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scheme-reports-wg2/CALnw4LL44aEVjrzD7j%3DLy_aub%2B01d5zud7fY1KVhWQWyjSTdEw%40mail.gmail.com.

Arthur A. Gleckler

unread,
Sep 5, 2021, 3:05:01 PM9/5/21
to scheme-re...@googlegroups.com
On Sun, Sep 5, 2021 at 11:06 AM Marc Nieper-Wißkirchen <marc....@gmail.com> wrote:
 
Syntax-parse is much more complicated to specify than syntax-case and needs a lot of other syntactic machinery of Racket (Racket-style keywords, for example).  Thus, if the macro system "syntax-case" is voted in, it will still make sense to offer the syntactic form syntax-case first (also for compatibility with existing implementations).  Then one can take one's time to see whether a more complicated but also more sophisticated matcher should be added as well.  (Personally, I would prefer the simplicity of syntax-rules/syntax-case.)
 
Ah, thanks for clarifying.  I knew I should have done some more reading before sending that message.  I'll do that now.
Reply all
Reply to author
Forward
0 new messages