[GAP Forum] Removing zeros from a list

Gordon Royle gordon.royle at uwa.edu.au
Mon May 10 02:57:43 BST 2021


When you changed your example from  [3,4,0,9] to [3,4,5,9] it was not the removing of the zero entry that made RemoveSet work.

It was the fact that your second example was a *sorted* list that made it work.

(As already suggested, Filtered will do the job, but it returns a new copy of the filtered list and does not affect the existing list)


From: Arkadiusz Bochniak <arkadiusz.bochniak at doctoral.uj.edu.pl>
Date: Friday, 7 May 2021 at 3:07 am
To: forum at gap-system.org <forum at gap-system.org>
Subject: [GAP Forum] Removing zeros from a list
Error, RemoveSet: <set> must be a mutable proper set
(not a non-strictly-sorted plain list

The same problem appeared when I tried to remove 9. On the other hand, when the list does not contain zeros there is no such a problem (e.g. it works perfectly for s := [3,4,5,9];; and RemoveSet(s,9); s;). What is the reason for that? How to fix it in order to be able to remove zeros from a given list?


More information about the Forum mailing list