4.6 Immutable Vectors
(require rebellion/collection/immutable-vector) | |
package: rebellion |
An immutable vector is an ordinary vector? that is immutable in the sense of immutable?. The rebellion/collection/immutable-vector module provides functions and predicates that always accept and return immutable vectors. These functions should always be used when a vector is known to be immutable, instead of using functions that work on either mutable or immutable vectors. This is analogous to how mutable lists are a completely separate data type from ordinary immutable lists.
procedure
(immutable-vector? v) → boolean?
v : any/c
procedure
(make-immutable-vector size v) → immutable-vector?
size : natural? v : any/c
procedure
(immutable-vector v ...) → immutable-vector?
v : any/c
procedure
(immutable-vector-length vec) → natural?
vec : immutable-vector?
procedure
(immutable-vector-ref vec pos) → any/c
vec : immutable-vector? pos : natural?
procedure
(immutable-vector->list vec) → list?
vec : immutable-vector?
procedure
lst : list?
procedure
(immutable-vector->values vec [start end]) → any
vec : immutable-vector? start : natural? = 0 end : natural? = (immutable-vector-length vec)
procedure
(build-immutable-vector size f) → immutable-vector?
size : natural? f : (-> natural? any/c)
procedure
(immutable-vector-map f vec ...+) → immutable-vector?
f : procedure? vec : immutable-vector?
procedure
(immutable-vector-append vec ...) → immutable-vector?
vec : immutable-vector?
procedure
(immutable-vector-take vec n) → immutable-vector?
vec : immutable-vector? n : natural?
procedure
(immutable-vector-take-right vec n) → immutable-vector?
vec : immutable-vector? n : natural?
procedure
(immutable-vector-drop vec n) → immutable-vector?
vec : immutable-vector? n : natural?
procedure
(immutable-vector-drop-right vec n) → immutable-vector?
vec : immutable-vector? n : natural?
procedure
(immutable-vector-split-at vec pos)
→
immutable-vector? immutable-vector? vec : immutable-vector? pos : natural?
procedure
(immutable-vector-split-at-right vec pos)
→
immutable-vector? immutable-vector? vec : immutable-vector? pos : natural?
procedure
(immutable-vector-copy vec start end) → immutable-vector?
vec : immutable-vector? start : natural? end : natural?
procedure
(immutable-vector-filter pred vec) → immutable-vector?
pred : predicate/c vec : immutable-vector?
procedure
(immutable-vector-filter-not pred vec) → immutable-vector?
pred : predicate/c vec : immutable-vector?
procedure
(immutable-vector-count f vec ...+) → natural?
f : procedure? vec : immutable-vector?
procedure
(immutable-vector-argmin f vec) → any/c
f : (-> any/c real?) vec : immutable-vector?
procedure
(immutable-vector-argmax f vec) → any/c
f : (-> any/c real?) vec : immutable-vector?
procedure
(immutable-vector-member v vec) → (or/c natural? #f)
v : any/c vec : immutable-vector?
procedure
(immutable-vector-memv v vec) → (or/c natural? #f)
v : any/c vec : immutable-vector?
procedure
(immutable-vector-memq v vec) → (or/c natural? #f)
v : any/c vec : immutable-vector?
procedure
(immutable-vector-sort vec less-than? [ start end #:key key #:cache-keys? cache-keys?]) → immutable-vector? vec : immutable-vector? less-than? : (-> any/c any/c boolean?) start : natural? = 0 end : natural? = (immutable-vector-length vec) key : (-> any/c any/c) = values cache-keys? : boolean? = #f
procedure
v : any/c
procedure
v : any/c