On this page:
immutable-vector?
make-immutable-vector
immutable-vector
immutable-vector-length
immutable-vector-ref
immutable-vector->list
list->immutable-vector
immutable-vector->values
build-immutable-vector
immutable-vector-map
immutable-vector-append
immutable-vector-take
immutable-vector-take-right
immutable-vector-drop
immutable-vector-drop-right
immutable-vector-split-at
immutable-vector-split-at-right
immutable-vector-copy
immutable-vector-filter
immutable-vector-filter-not
immutable-vector-count
immutable-vector-argmin
immutable-vector-argmax
immutable-vector-member
immutable-vector-memv
immutable-vector-memq
immutable-vector-sort
empty-immutable-vector
empty-immutable-vector?
nonempty-immutable-vector?
7.4

4.3 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
A predicate for immutable vectors. Implies vector? and immutable?.

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

(list->immutable-vector lst)  immutable-vector?

  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

(empty-immutable-vector? v)  boolean?

  v : any/c

procedure

(nonempty-immutable-vector? v)  boolean?

  v : any/c