Summary

Complete SRFI-46 support

Metadata

Attachments

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.

Changes and comments

[2010-09-10 16:22:00 UTC] sjamaan attached srfi-46.patch (description=Full SRFI-46 support)

[2010-09-14 15:34:33 UTC] felix wrote:

The patch uses `drop-right`, which isn't available in csi by default.

[2010-09-14 19:37:55 UTC] sjamaan wrote:

It provides its own. Look at the top where the big LET is (line 115)

[2010-10-19 22:10:13 UTC] sjamaan wrote:

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)

[2011-02-09 10:50:34 UTC] felix changed status from new to closed

[2011-02-09 10:50:34 UTC] felix set resolution to fixed

[2011-02-09 10:50:34 UTC] felix wrote:

Has been added to both experimental and master.

[2011-06-01 09:00:41 UTC] felix changed milestone from 4.7.0 to 4.8.0

[2011-06-01 09:00:41 UTC] felix wrote:

Milestone 4.7.0 deleted

[2012-09-24 21:47:48 UTC] felix wrote:

Milestone 4.8.0 deleted

[2012-09-24 21:47:48 UTC] felix changed milestone from 4.8.0 to 4.9.0