next up previous index
Next: String Manipulation Commands Up: List Manipulation Commands Previous: Creation

Modification

lappend   varName value ?value ... ?
Append the value arguments to the value stored in the variable varName and return the list. If the variable does not exist, it is created:
% lappend v abc
abc
% lappend v def
abc def
Note that this is an efficient destructive update, no copying takes place.

linsert   list index value ?value ... ?
Returns a new list where all value arguments are inserted before the index-th element:
% linsert {a b c d} 1 3 4
a 3 4 b c d

lreplace   list first last ?value value ... ?
Returns a new list where the specified range has been replaced by all the value arguments:
% lreplace {a b c d} 1 2 10 20 30
a 10 20 30 d

lsort   ?mode? ?direction? list
Sort the list according to the given criteria. The modes are The default mode is -ascii.

The direction is either -increasing (default) or -decreasing.



Micha Meier
Tue Jul 2 09:49:39 MET DST 1996