[R6RS] syntax-case

Manuel Serrano Manuel.Serrano
Fri Oct 15 03:44:12 EDT 2004


> A few days before the meeting in Utah I posted a proposal for syntax-case.
> I've started working in some changes that the syntax-case subcomittee
> (Matthew and I) agreed upon and have also started to add more detail.
> It's getting to be quite a bit of work, so before I proceed any further,
> I'd like to understand the position of the committee with respect to
> syntax-case.  If it's definitely going to go in, I'll keep working on a
> detailed proposal.  If there's still some question, I'd rather put off
> the detail work.
> 
> According to my notes from the meeting, those present all agreed that
> we should include syntax-case and associated mechanisms, but we didn't
> have a formal vote, Richard wasn't present, and Marc's slides listed
> it to my surprise as something we hadn't come to any agreement upon.
> (There were several other things, like exceptions, that I was also
> surprised to see in this category.)
> 
> I'd like to hear from anyone who objects to including syntax-case and to
> have a vote after a few days on whether we should include syntax-case,
> subject of course to final acceptance of the more detailed proposal.
My point at the meeting was that (IMHO) since generalized pattern matching is 
useful, we should provide a special form for pattern matching ? la 
Bigloo' MATCH-CASE 
(see http://www-sop.inria.fr/mimosa/fp/Bigloo/doc/bigloo-7.html). I have 
nothing against SYNTAX-CASE as long as the pattern matching language it
relies on is the same as the pattern matching we should provide. To the
extreme, your example:

  (define-syntax foo
    (set!-aware-transformer
      (lambda (x)
        (syntax-case x (set! :=)
          [(set! _ y) #'(set! bar y)]
          [(_ := y) #'(set! bar y)]))))

Could be "almost" re-written in:

  (define-syntax foo
    (set!-aware-transformer
      (lambda (x)
        (match-case x 
          (#'(set! _ ?y) #'(set! bar y))
          (#'(?- := ?y) #'(set! bar y))))))

-- 
Manuel


More information about the R6RS mailing list