Opened 4 years ago
Closed 2 years ago
#1794 closed defect (duplicate)
(r7rs) syntax-rules doesn't allow combining ellipsis and dotted tail
| Reported by: | sjamaan | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 6.0.0 |
| Component: | unknown | Version: | 5.3.0 |
| Keywords: | r7rs, syntax-rules, macros | Cc: | evhan |
| Estimated difficulty: | medium |
Description
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.
Change History (3)
comment:1 Changed 4 years ago by
comment:2 Changed 2 years ago by
| Milestone: | 5.4 → 6.0.0 |
|---|
comment:3 Changed 2 years ago by
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
Note: See
TracTickets for help on using
tickets.

NOTE: seems to be a duplicate of #1736 which claims this was already part of SRFI 46, so I think we should try and support it in core.