The standard library sparse_rw_vector package implements mutable-vector functionality via hashtables, allowing large numbers of zero entries without unreasonable ram consumption.
The sparse_rw_vector package API is specified anonymously in-line in the source.
The sparse_rw_vector package source code is in src/lib/src/sparse-rw-vector.pkg.
See also: hashtable.
See also: rw_vector.
The above information is manually maintained and may contain errors.
api { Rw_Vector X = ...; Vector X = Vector(X ); maximum_vector_length : Int; make_rw_vector : (Int , X) -> Rw_Vector(X ); from_list : List(X ) -> Rw_Vector(X ); from_fn : (Int , (Int -> X)) -> Rw_Vector(X ); length : Rw_Vector(X ) -> Int; get : (Rw_Vector(X ) , Int) -> X; _[] : (Rw_Vector(X ) , Int) -> X; set : (Rw_Vector(X ) , Int , X) -> Void; _[]:= : (Rw_Vector(X ) , Int , X) -> Void; to_vector : Rw_Vector(X ) -> Vector(X ); copy : {at:Int, from:Rw_Vector(X ), into:Rw_Vector(X )} -> Void; copy_vector : {at:Int, from:Vector(X ), into:Rw_Vector(X )} -> Void; apply : (X -> Void) -> Rw_Vector(X ) -> Void; keyed_apply : ((Int , X) -> Void) -> Rw_Vector(X ) -> Void; map_in_place : (X -> X) -> Rw_Vector(X ) -> Void; keyed_map_in_place : ((Int , X) -> X) -> Rw_Vector(X ) -> Void; fold_forward : ((X , Y) -> Y) -> Y -> Rw_Vector(X ) -> Y; fold_backward : ((X , Y) -> Y) -> Y -> Rw_Vector(X ) -> Y; keyed_fold_forward : ((Int , X , Y) -> Y) -> Y -> Rw_Vector(X ) -> Y; keyed_fold_backward : ((Int , X , Y) -> Y) -> Y -> Rw_Vector(X ) -> Y; find : (X -> Bool) -> Rw_Vector(X ) -> Null_Or(X ); keyed_find : ((Int , X) -> Bool) -> Rw_Vector(X ) -> Null_Or(((Int , X)) ); exists : (X -> Bool) -> Rw_Vector(X ) -> Bool; all : (X -> Bool) -> Rw_Vector(X ) -> Bool; compare_sequences : ((X , X) -> Order) -> (Rw_Vector(X ) , Rw_Vector(X )) -> Order; make_rw_vector' : (Int , (Int -> X)) -> Rw_Vector(X ); make_rw_vector'' : (Int , (Int -> X)) -> Rw_Vector(X ); remove : (Rw_Vector(X ) , Int) -> Void; clear : Rw_Vector(X ) -> Void; dom : Rw_Vector(X ) -> List(Int ); copy_rw_vector : Rw_Vector(X ) -> Rw_Vector(X );};