insert
insert — inserts an array value at a given position.
insert (array, position|compare_function, value)
arrayAn array.
positionA number giving the zero-based position of the new element within the array, or a function.
compare_functionA function on two arguments used to compare elements in the list or array.
valueAny Gamma or Lisp expression.
The value inserted.
The insert function widens an array at the given
position and inserts the
value. If a
compare_function is used, it must return a
negative number if the value is ordinally less than the array element, 0 if
the two are equal and a positive number if the value is ordinally greater
than the array element. The value will be inserted
using a binary insertion sort, based on the return value of the function.
Gamma>x = array("a", "b", "c");["a" "b" "c"]Gamma>insert(x,3,"d");"d"Gamma>x;["a" "b" "c" "d"]Gamma>insert(x,strcmp,"acme");"acme"Gamma>x;["a" "acme" "b" "c" "d"]Gamma>