## expanding-rw-vector.api
# Compiled by:
#
src/lib/std/standard.lib# Api for unbounded typeagnostic arrays.
# See also:
src/lib/src/typelocked-expanding-rw-vector.apiapi Expanding_Rw_Vector {
Rw_Vector(X);
rw_vector: ((Int, X)) -> Rw_Vector(X);
#
# rw_vector (size, e) creates an unbounded rw_vector all of whose elements
# are initialized to e. size (>= 0) is used as a
# hint of the potential range of indices. Raises SIZE if a
# negative hint is given.
copy_rw_subvector: ((Rw_Vector(X), Int, Int)) -> Rw_Vector(X);
#
# subArray (a, lo, hi) creates a new rw_vector with the same default
# as a, and whose values in the range [0, hi-lo] are equal to
# the values in b in the range [lo, hi].
# Raises SIZE if lo > hi
from_list: (List(X), X) -> Rw_Vector(X);
#
# arrayoflist (l, v) creates an rw_vector using the list of values l
# plus the default value v.
from_fn: ((Int, (Int -> X), X)) -> Rw_Vector(X);
#
# from_fn (size, fill, default) acts like rw_vector::from_fn, plus
# stores default value default. Raises SIZE if size < 0.
default: Rw_Vector(X) -> X;
# Default returns rw_vector's default value
get: ( (Rw_Vector(X), Int)) -> X;
# sub (a, idx) returns value of the rw_vector at index idx.
# If that value has not been set by update, it returns the default value.
# Raises INDEX_OUT_OF_BOUNDS if idx < 0
set: ((Rw_Vector(X), Int, X)) -> Void;
# update (a, idx, v) sets the value at index idx of the rw_vector to v.
# Raises INDEX_OUT_OF_BOUNDS if idx < 0
bound: Rw_Vector( X) -> Int;
# bound returns an upper bound on the index of values that have been
# changed.
truncate: ((Rw_Vector(X), Int)) -> Void;
# truncate (a, size) makes every entry with index > size the default value
# * what about iterators??? * XXX BUGGO FIXME
}; # unbounded-rw-vector
## COPYRIGHT (c) 1999 Bell Labs, Lucent Technologies.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.