Summary

Better error reporting for srfi-26

Metadata

Attachments

Description

 
 {{{(cut)}}} and {{{(cute)}}} both give an internal error; "Error: (car) during expansion of (cute ...) - bad argument type: ()". This should be a more contextually relevant error.
 
 Here's two patches; one allows suffix patterns, the variables for which simply get consumed placewise from the right (similar to #379). Normal variables get consumed from the left and if anything's left in between, that's used for the placeholder. The above example would return 2.
 
 The other patch simply checks for the presence of extra args and throws an error if there are any.
 
 Both patches add an error message for when you do {{{(cut)}}}.

Changes and comments

[2010-09-13 15:58:38 UTC] sjamaan attached srfi-26-extension.patch (description=The version that adds an extension that allows tail patterns)

[2010-09-13 16:00:15 UTC] sjamaan wrote:

As you probably noticed, I also added the srfi-26 testcases from the srfi document to Chicken's test cases for future hacking on it.

[2010-09-13 16:06:32 UTC] sjamaan wrote:

By the way, if ``chop from data-structures or ``take-right and ``drop-right'' from srfi-1 would be available in the syntax code, both this and #379 could be simplified (and this one would be a little more efficient, I suppose).

[2010-09-13 16:06:51 UTC] sjamaan wrote:

Damn you, Trac

[2010-09-13 16:18:45 UTC] sjamaan wrote:

By the way: I considered adding the extension because currently we have no real alternative for the now removed left-section & right-section (unless I'm missing something, which is quite possible). This extension would allow the following conversion:

 ((left-section list 1 2 3) 4 5 6) <=> ((cut list 1 2 3 <...>) 4 5 6)
 ((right-section list 4 5 6) 1 2 3) <=> ((cut list <...> 4 5 6) 1 2 3)

[2010-09-14 18:55:53 UTC] felix wrote:

the error-checking patch has been applied (experimental).

[2010-09-14 19:00:08 UTC] felix wrote:

Replying to felix: > the error-checking patch has been applied (experimental).

Doesn't compile.

[2010-09-14 20:37:33 UTC] sjamaan attached srfi-26-error.patch (description=New version of error-checking patch)

[2010-09-14 20:38:29 UTC] sjamaan wrote:

Sorry about that. I replaced it with one that does work.

(of course, secretly, I sabotaged this one hoping you'd apply the more feature-rich one...But you foiled the plan!)

[2010-09-15 10:15:07 UTC] felix wrote:

Replying to sjamaan: > Sorry about that. I replaced it with one that does work. >

Thanks - now it has been committed.

[2010-09-15 14:06:03 UTC] sjamaan changed status from new to closed

[2010-09-15 14:06:03 UTC] sjamaan set resolution to fixed

[2010-09-15 14:06:03 UTC] sjamaan wrote:

OK, then I'll close this

[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 changed milestone from 4.8.0 to 4.9.0

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

Milestone 4.8.0 deleted