This library module provides extendible arrays with logarithmic access time.
Please note: the atom
$ is used to indicate an unset element, and the
$/4 is used to indicate a subtree. In general, array
elements whose principal function symbol is
$ will not work.
new_array(-A) returns a new empty array A.
checks whether A is an array.
returns a list of pairs Index-Element of all the elements of Array that have been set.
aref(+Index, +Array, -Element)
unifies Element with Array[Index], or fails if Array[Index] has not been set.
arefa(+Index, +Array, -Element)
aref/3, except that it unifies Element with a new array if
Array[Index] is undefined. This is useful for multidimensional
arrays implemented as arrays of arrays.
arefl(+Index, +Array, -Element)
aref/3, except that Element appears as
aset(+Index, +Array, +Element, -NewArray)
unifies NewArray with the result of setting Array[Index] to Element.