Note that this is an efficient destructive update, no copying takes place.% lappend v abc abc % lappend v def abc def
% linsert {a b c d} 1 3 4 a 3 4 b c d
% lreplace {a b c d} 1 2 10 20 30 a 10 20 30 d
% lsort -ascii {1 2 3 10 20 30} 1 10 2 20 3 30
% lsort -integer {1 2 3 10 20 30} 1 2 3 10 20 30
% lsort -real {1 2 3 1.0 2.0 3.0} 1 1.0 2.0 2 3 3.0
The direction is either -increasing (default) or -decreasing.