Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in ListX with empty arguments #902

Closed
laurentbartholdi opened this issue Sep 26, 2016 · 5 comments
Closed

Bug in ListX with empty arguments #902

laurentbartholdi opened this issue Sep 26, 2016 · 5 comments
Milestone

Comments

@laurentbartholdi
Copy link
Contributor

The test on line 1846 of colls.gi seems to harsh:

Observed behaviour

gap> ListX([],function(args) return args; end);
Error, gens[1] must be a collection, a boolean, or a function called from
ListXHelp0( result, arg, 0 ); called from

Expected behaviour

gap> ListX([],function(args) return args; end);
[ ]

Copy and paste GAP banner (to tell us about your setup)

GAP, Version 4.7.6 of 15-Nov-2014 (free software, GPL)
(but also the most recent github pull)

@ChrisJefferson
Copy link
Contributor

I agree. Just for completeness, the same bug occurs in SetX, ProductX and SumX.

The problem is that the X family of functions demand a collection, so this also fails:

ListX([2,"abc"], x -> x), which I see no reason to fail either.

I think the fix is just to turn IsCollection into "can be iterated over" (because that's what we actually care about, and do). What I'm not sure about is if we have a function to do that. We could (at the risk of losing the error message), just try iterating, and then the error would move to no 1st choice method found for Iterator.

@ChrisJefferson
Copy link
Contributor

Should probably just be IsListOrCollection, forgot about that function.

@ChrisJefferson
Copy link
Contributor

Now fixed in #903 (along with general other improvements).

@olexandr-konovalov
Copy link
Member

@laurentbartholdi any reasons to use GAP 4.7.6 of 15-Nov-2014 btw?

@laurentbartholdi
Copy link
Contributor Author

Yes, it's the gap on my office computer - no space for a private install.

On Tue, Sep 27, 2016, 21:52 Alexander Konovalov notifications@github.com
wrote:

@laurentbartholdi https://github.com/laurentbartholdi any reasons to
use GAP 4.7.6 of 15-Nov-2014 btw?


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#902 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACIIUNfmhf1mZr52alK211YvLAABtjlsks5quXQIgaJpZM4KGaDx
.

Laurent Bartholdi
DMA, École Normale Supérieure, 45 rue d'Ulm, 75005 Paris. +33 14432 2060
Mathematisches Institut, Universität Göttingen, Bunsenstrasse 3-5, D-37073
Göttingen. +49 551 39 7826

@olexandr-konovalov olexandr-konovalov added this to the GAP 4.9.0 milestone Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants