Summary

map allows non-list arguments

Metadata

Description

If the first list argument to map is not actually a list, map will just return (). Version: git fd66e1b (master)

#;1> (map (lambda (x) x) 'foo) () #;2> (map 'foo 'foo) ()

Changes and comments

[2010-04-30 19:56:03 UTC] zbigniew wrote:

More data points: peter reports the same issue with 4.4.0, while mario (4.4.6) and moritz (4.4.6) find it works correctly.

I used `make spotless` and rebuilt the compiler with itself and it is still giving this issue. But it doesn't make sense; the code is clear that an error should occur.

Originally this was on 4.4.6 macosx-unix-gnu-x86 but I have now reproduced it from a clean git clone on another platform, 4.4.6 linux-unix-gnu-x86.

[2010-04-30 21:02:17 UTC] zbigniew wrote:

As seen at http://paste.lisp.org/display/98612 the compiled output appears to be wrong, it appears to be an issue with internal-compiler-syntax on ##sys#map etc. where the argument is only tested for pair?. An error is not thrown for non-lists.

[2010-04-30 21:12:58 UTC] zbigniew changed status from new to assigned

[2010-04-30 21:12:58 UTC] zbigniew set owner to felix

[2010-04-30 21:12:58 UTC] zbigniew wrote:

Issue also affects for-each. Looks like a straightforward fix but I will let you handle it from here.

[2010-04-30 21:49:57 UTC] zbigniew wrote:

mario says galinha is using Chicken 4.2.0 to generate the snapshots, which explains why the snapshot bootstrap files are not affected; this problem was introduced in Chicken 4.2.1.

[2010-05-02 00:44:55 UTC] felix changed status from assigned to accepted

[2010-05-02 00:44:55 UTC] felix set version to 4.4.x

[2010-05-02 01:16:30 UTC] felix set resolution to fixed

[2010-05-02 01:16:30 UTC] felix wrote:

In 22699fd729e2b1e08e8bdb2d6a5d640382d209d8 (experimental), a check has been added (unless in unsafe mode). Note that this only checks for the arguments being lists, not "proper" lists - the loops terminate on the first non-pair argument found.

[2010-05-02 01:16:30 UTC] felix changed status from accepted to closed

[2011-04-04 08:31:00 UTC] felix removed milestone 4.6.0

[2011-04-04 08:31:00 UTC] felix wrote:

Milestone 4.6.0 deleted