next up previous contents index
Next: Adding numbers in a Up: Basics of GAP Previous: Using for loops   Contents   Index

Sets

The AsSet command converts a list to a set and back to a list. In effect, it removes all extraneous elements.

gap> L:=[3,1];
[ 3, 1 ]
gap> AsSet(L);
[ 1, 3 ]
gap> L;
[ 3, 1 ]
gap> Append(L,[1]);
gap> L;
[ 3, 1, 1 ]
gap> AsSet(L);
[ 1, 3 ]



David Joyner 2002-08-23