**** This makes it easy to sort.

Ancestors
 ARRAY{_} \$ARR{_} \$RO_ARR{_} \$CONTAINER{_} \$ELT{_} \$ELT AREF{_}

Public

Features
 **** The element of self with index `ind'. Built-in.
 **** A new array consisting of self followed by `a'. Both may be void.
 **** A new array consisting of self followed by `a1' and `a2'. More efficient than two appends. Any of the arrays may be void.
 **** A new array consisting of self followed by `a1', `a2' and `a3'. More efficient than three appends. Any of them may be void.
 **** Set the element of self with index `ind' to `val'. Built-in.
 **** The number of elements in self. Classes which inherit this may replace this by a constant to get constant sized objects (and the compiler may optimize certain operations in this case). Built-in.
 **** Assuming self is sorted, return the index of the element preceding the first element greater than `e' according to `elt_lt'. -1 if self is void or if all elements are greater than `e'.
 **** Assuming self is sorted by `lt', return the index of the element preceding the first element greater than `e'. -1 if self is void or if all elements are greater than `e'.
 **** Set each array element to void. Built-in. Self may be void. if ~void(self) then aclear end end;
 **** True if the self has an element which is `elt_eq' to `e'.
 **** Copy as many elements from `src' to self as will fit. Both self and `src' may be void. if ~void(self) and ~void(src) then acopy(src) end end;
copy(beg:INT,src:SAME)
copy(beg,num:INT, src:SAME)
copy(beg,num,srcbeg:INT,src:SAME)
 **** A copy of self.
 **** The number of elements that are `elt_eq' to `v'. Self may be void.
 **** The number of elements which satisfy `test'. Self may be void.
create(a: ARRAY{T}): SAME
 **** Create a new array of size `n' all of whose elements are void.
create: SAME
 **** Create an array out of the elements of "e" Expensive - first converts into an FLIST to determine the number of elements and then converts the FLIST into an array. Another possibility would be to iterate twice through the elements in "e", but iterating through "e" might be an even more expensive operation. It might also not be possible to iterate through "e" more than once, depending on the nature of "e"
 **** The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants.
 **** A hash value associated with an element. Must have the property that if "elt_eq(e1,e2)" then "elt_hash(e1)=elt_hash(e2)". Can be defined to always return 0, but many routines will then become quadratic. Uses object "id" by default. May be redefined in descendants.
elt_lt(x,y:CODE_FILE):BOOL
 **** Return the nil value. If the element is under \$NIL then return e.nil. Otherwise, return void _
equals(a: \$RO_ARR{T}): BOOL
 **** True if every element of self satisfies `test'. Self may be void.
 **** Return leftmost element of self which satisfies `test', or void if there is none. Self may be void.
has(e: T): BOOL
 **** Return true if "i" is a valid index
 **** Return the index of the leftmost element that satisfies `test', or -1 if there is none. Self may be void.
 **** Return the index of the leftmost element which is `elt_eq' to `e' or -1 if there is none. Self may be void.
 **** Return an index array which is the same size as self and is set to the values of the indices
 **** Stably sort the elements of self using `t' to define "less than". Self may be void.
 **** pre ~void(self) and l.is_bet(0,asize-1) and u.is_bet(l,asize-1)
is_elt_nil(e:ETP):BOOL
 **** True if the elements of self are in sorted order according to `elt_lt'. Self may be void.
 **** True if the elements of self are in sorted order using `t' to define "less than". Self may be void.
 **** Set each element of self to the result of applying `r' to it. Self may be void.
 **** The median of the elements contained in self according to the ordering relation `elt_lt'. Permutes the elements of self. Void if self is void.
merge_with_by(a:SAME, lt:ROUT{T,T}:BOOL):SAME
 **** The index of the first element of self which differs from `a'. -1 if self is a prefix of `a' or self is void.
 **** True if none of the elements of self satisfies `test'. Self may be void.
 **** True if not every element of self satisfies `test'. Self may be void.
quicksort_range(l,u:INT)
 **** Combine all the elements of self by applying `r' from low indices to high. Void if self is void or size=0.
 **** A new array without the elements which are `elt_eq' to `e'. Self may be void.
 **** A new array with only the first copy of duplicated elements. Self may be void, but must be sorted on input.
 **** A new array without the elements that satisfy `test'. Self may be void.
 **** Allocate a new array and copy whatever will fit of the old portion. Returns the new array.
 **** A copy of self with the elements in reverse order. Self may be void.
 **** Set each element in self to the result of applying `r' left to right to the array up to the element. The first element is left unchanged. Self may be void.
 **** The index of the leftmost subarray of self which matches `a'. -1 if none or self is void. Uses simple algorithm which has good performance unless the arrays are special (eg. many repeated values).
 **** The index of the leftmost subarray of self starting at `beg' or beyond, which matches `a'. -1 if none. Uses simple algorithm which has good performance unless the arrays are special (eg. many repeated values).
 **** Move the elements of self so that the element with index `i' is not `elt_lt' any element with lower indices and no element with a larger index is `elt_lt' it.
 **** Move the elements of self so that the element with index `i' is not `lt' any element with lower indices and no element with a larger index is `lt' it.
 **** The number of elements in the array. Self may be void. if void(self) then return 0 else return asize end end;
 **** True if some element of self satisfies `test'. Self may be void.
 **** Use quicksort to permute the elements of self so that it is sorted with respect to `elt_lt'. Self may be void.
 **** Use insertion sort to permute the elements of self so that it is sorted with respect to `elt_lt'. Equal elements retain their initial order. Self may be void.
 **** Prints out a string version of the array of the components that are under \$STR, and their associated indices
subarr(beg,num:INT):SAME
 **** Make self be a copy of `src'. Both may be void.
 **** Replace elements that are `elt_eq' to `o' by `n' where ever it occurs. Self may be void.
 **** Replace elements that satisfy `test' by `n'. Self may be void.
 **** Reverse the order of the elements in self. Self may be void.
 **** Set each element of self to `v'. Self may be void.

Iters
 **** Yield each element of self starting at `beg'. Self may not be void. loop yield aelt!(beg) end end;
elt!(once beg, once num:INT):T
elt!(once beg, once num, once step:INT):T
 **** Yield each element of self in order. Self may be void. if ~void(self) then loop yield aelt! end end end;
 **** Yield the indices of self in order. Self may be void. if ~void(self) then loop yield aind! end end end;
 **** Yield the indices of self in order. Self may be void. this is provided for consistency with ARRAY2 and ARRAY3 if ~void(self) then loop yield aind! end end end;
 **** Set successive elements of self to the values of `val'. Self may be void. if ~void(self) then loop aset!(val); yield end end end;
 **** Set successive elements starting at `beg' to the values of `val'. Self may not be void. loop aset!(beg,val); yield end end;
set!(once beg,once num:INT,val:T)
set!(once beg,once num,once step:INT,val:T)

Private

 **** Set each element of self to nil. Built-in.
 **** Copy as many elements from `src' to self as will fit. Built-in.
 **** Copy as many elements from `src' to self as will fit when starting at index `beg' of self.
 **** Copy `num' elements from `src' to self starting at index `beg' of self.
 **** Copy `num' elements from `src' to self starting at index `beg' of self and index `srcbeg' of `src'. Built-in.
 **** Yield each element of self starting at `beg'. Built-in.
 **** Yield `num' successive elements of self starting at index `beg'. Built-in.
 **** Yield `num' elements of self starting at `beg' and stepping by `step' which must not be zero. Built-in.
 **** Yield each element of self in order. Built-in.
 **** Yield the indices of self in order.
 **** Set successive elements of self to the values `val'. Built-in.
 **** Set successive elements of self starting at `beg' to the values `val'.
 **** Set `num' successive elements of self starting at `beg' to the values `val'.
 **** Set `num' elements of self starting at `beg' stepping by `step' to the values `val'. `step' must not be zero.
elt_str(e: T,i: INT): STR
 **** True if the arguments are legal values for `aelts'.
 **** When to stop the quicksort recursion and switch to insertion sort.