Unbind( rec.name )
Unbind( list[n] )
In the first form Unbind
deletes the component with the name name in
the record rec. That is, after execution of Unbind
, rec no longer
has a record component with this name. Note that it is not an error to
unbind a nonexisting record component. rec must evaluate to a record,
otherwise an error is signalled.
In the second form Unbind
deletes the element at the position n in
the list list. That is, after execution of Unbind
, list no longer
has an assigned value at the position n. Note that it is not an error
to unbind a nonexisting list element. list must evaluate to a list,
otherwise an error is signalled.
gap> r := rec( a := 1, b := 2 );; gap> Unbind( r.a ); r; rec( b := 2 ) gap> Unbind( r.c ); r; rec( b := 2 ) gap> l := [ , 2, 3, 5, , 7, , , , 11 ];; gap> Unbind( l[3] ); l; [ , 2,, 5,, 7,,,, 11 ] gap> Unbind( l[4] ); l; [ , 2,,,, 7,,,, 11 ]
Note that Unbind
does not evaluate its argument, otherwise there would
be no way for Unbind
to tell which component to remove in which record,
because it would only receive the value of this component.
GAP 3.4.4