Append( list1, list2 )
Append
adds (see Add) the elements of the list list2 to the end of
the list list1. list2 may contain holes, in which case the
corresponding entries in list1 will be left unbound. Append
returns
nothing, it is called only for its side effect.
gap> l := [ 2, 3, 5 ];; Append( l, [ 7, 11, 13 ] ); l; [ 2, 3, 5, 7, 11, 13 ] gap> Append( l, [ 17,, 23 ] ); l; [ 2, 3, 5, 7, 11, 13, 17,, 23 ]
Note that appending to a list changes the list. The ability to change an object is only available for lists and records (see Identical Lists).
Note that Append
changes the first argument, while Concatenation
(see
Concatenation) creates a new list and leaves its arguments unchanged.
As usual the name of the function that work destructively is a verb, but
the name of the function that creates a new object is a substantive.
GAP 3.4.4