28.5 RemoveSet

RemoveSet( set, elm )

RemoveSet removes the element elm, which may be an object of arbitrary type, from the set set, which must be a set, otherwise an error will be signalled. If elm is not an element of set nothing happens. If elm is an element it is removed and all the following elements in the list are moved one position forward.

    gap> s := [ 2, 3, 4, 5, 6, 7 ];;
    gap> RemoveSet( s, 6 );
    gap> s;
    [ 2, 3, 4, 5, 7 ]
    gap> RemoveSet( s, 10 );
    gap> s;
    [ 2, 3, 4, 5, 7 ] 

AddSet (see AddSet) is the counterpart of RemoveSet.

Previous Up Top Next
Index

GAP 3.4.4
April 1997