#379 closed defect (fixed)
Complete SRFI-46 support
Reported by: | sjamaan | Owned by: | felix winkelmann |
---|---|---|---|
Priority: | minor | Milestone: | 4.9.0 |
Component: | core libraries | Version: | 4.6.x |
Keywords: | syntax-rules, srfi-46 | Cc: | |
Estimated difficulty: |
Description
I got bored so I decided to finish srfi-46 support.
Right now we have support for custom ellipsis identifiers, which is half of SRFI-46. It's much simpler to explain that Chicken supports SRFI-46 than just the ellipsis stuff, and tail patterns provide for slightly more powerful macros.
During my work on it I also found a bug in the way vectors are matched:
(define-syntax foo (syntax-rules () ((_ #((a) ...)) (list a ...)))) (foo #((1))) => error. It should return (1)
I just dropped the specialized vector matching and converted vectors to list, on match too (it was already done this way for the patterns). This solves any vector-specific bugs and also helps keep the code compact. If speed is an issue, I also have a version that adds SRFI-46 to the vector-specific code.
If there's a better way to do the take-right and drop-right, I'd be happy to hear it.
Attachments (1)
Change History (7)
Changed 14 years ago by
Attachment: | srfi-46.patch added |
---|
comment:1 Changed 14 years ago by
The patch uses drop-right
, which isn't available in csi by default.
comment:2 Changed 14 years ago by
It provides its own. Look at the top where the big LET is (line 115)
comment:3 Changed 14 years ago by
It looks like tail patterns will make it into WG1 of R7 Scheme, another good reason to include it. (http://lists.scheme-reports.org/pipermail/scheme-reports/2010-October/000075.html)
comment:4 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Has been added to both experimental and master.
Full SRFI-46 support