chicken-janitors
[Top][All Lists]
Advanced

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

#1794: (r7rs) syntax-rules doesn't allow combining ellipsis and dotted t


From: Chicken Trac
Subject: #1794: (r7rs) syntax-rules doesn't allow combining ellipsis and dotted tail
Date: Fri, 26 Nov 2021 09:37:38 -0000

#1794: (r7rs) syntax-rules doesn't allow combining ellipsis and dotted tail
--------------------------------+----------------------------------------
            Reporter:  sjamaan  |       Type:  defect
              Status:  new      |   Priority:  major
           Milestone:  5.4      |  Component:  unknown
             Version:  5.3.0    |   Keywords:  r7rs, syntax-rules, macros
Estimated difficulty:  medium   |
--------------------------------+----------------------------------------
 According to the R7RS spec, the following should match:

 {{{
 (define-syntax match-ellipsis-and-dotted-tail1
   (syntax-rules ()
     ((_ a ... . b)
      '(a ... b))))

 (print (match-ellipsis-and-dotted-tail1 x y . z))
 }}}

 And this, too:

 {{{
 (define-syntax match-ellipsis-and-dotted-tail2
   (syntax-rules ()
     ((_ (a) ... . (b))
      '(a ... b))))

 (print (match-ellipsis-and-dotted-tail2 (x) (y) z))
 }}}

 Both should print `(x y z)`.

 Might be nice to support this in the core `syntax-rules`, or if it's too
 tricky, we could just support it only in the R7RS egg.

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/1794>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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