5.1 Safe Homogenous Vectors
(require ffi/vector) | package: base |
Homogenous vectors are similar to C vectors (see Safe C Vectors), except that they define different types of vectors, each with a fixed element type. An exception is the u8 family of bindings, which are just aliases for byte-string bindings; for example, make-u8vector is an alias for make-bytes.
procedure
(make-u8vector len) → u8vector?
len : exact-nonnegative-integer? (u8vector val ...) → u8vector? val : byte? (u8vector? v) → boolean? v : any/c (u8vector-length vec) → exact-nonnegative-integer? vec : u8vector? (u8vector-ref vec k) → byte? vec : u8vector? k : exact-nonnegative-integer? (u8vector-set! vec k val) → void? vec : u8vector? k : exact-nonnegative-integer? val : byte? (list->u8vector lst) → u8vector? lst : (listof byte?) (u8vector->list vec) → (listof byte?) vec : u8vector? (u8vector->cpointer vec) → cpointer? vec : u8vector?
procedure
(make-s8vector len) → s8vector?
len : exact-nonnegative-integer? (s8vector val ...) → s8vector? val : (integer-in -128 127) (s8vector? v) → boolean? v : any/c (s8vector-length vec) → exact-nonnegative-integer? vec : s8vector? (s8vector-ref vec k) → (integer-in -128 127) vec : s8vector? k : exact-nonnegative-integer? (s8vector-set! vec k val) → void? vec : s8vector? k : exact-nonnegative-integer? val : (integer-in -128 127) (list->s8vector lst) → s8vector? lst : (listof (integer-in -128 127)) (s8vector->list vec) → (listof (integer-in -128 127)) vec : s8vector? (s8vector->cpointer vec) → cpointer? vec : s8vector?
procedure
(make-s16vector len) → s16vector?
len : exact-nonnegative-integer? (s16vector val ...) → s16vector? val : (integer-in -32768 32767) (s16vector? v) → boolean? v : any/c (s16vector-length vec) → exact-nonnegative-integer? vec : s16vector? (s16vector-ref vec k) → (integer-in -32768 32767) vec : s16vector? k : exact-nonnegative-integer? (s16vector-set! vec k val) → void? vec : s16vector? k : exact-nonnegative-integer? val : (integer-in -32768 32767) (list->s16vector lst) → s16vector? lst : (listof (integer-in -32768 32767)) (s16vector->list vec) → (listof (integer-in -32768 32767)) vec : s16vector? (s16vector->cpointer vec) → cpointer? vec : s16vector?
syntax
(_s16vector mode maybe-len)
_s16vector
procedure
(make-u16vector len) → u16vector?
len : exact-nonnegative-integer? (u16vector val ...) → u16vector? val : (integer-in 0 65535) (u16vector? v) → boolean? v : any/c (u16vector-length vec) → exact-nonnegative-integer? vec : u16vector? (u16vector-ref vec k) → (integer-in 0 65535) vec : u16vector? k : exact-nonnegative-integer? (u16vector-set! vec k val) → void? vec : u16vector? k : exact-nonnegative-integer? val : (integer-in 0 65535) (list->u16vector lst) → u16vector? lst : (listof (integer-in 0 65535)) (u16vector->list vec) → (listof (integer-in 0 65535)) vec : u16vector? (u16vector->cpointer vec) → cpointer? vec : u16vector?
syntax
(_u16vector mode maybe-len)
_u16vector
procedure
(make-s32vector len) → s32vector?
len : exact-nonnegative-integer? (s32vector val ...) → s32vector? val : (integer-in -2147483648 2147483647) (s32vector? v) → boolean? v : any/c (s32vector-length vec) → exact-nonnegative-integer? vec : s32vector? (s32vector-ref vec k) → (integer-in -2147483648 2147483647) vec : s32vector? k : exact-nonnegative-integer? (s32vector-set! vec k val) → void? vec : s32vector? k : exact-nonnegative-integer? val : (integer-in -2147483648 2147483647) (list->s32vector lst) → s32vector? lst : (listof (integer-in -2147483648 2147483647)) (s32vector->list vec) → (listof (integer-in -2147483648 2147483647)) vec : s32vector? (s32vector->cpointer vec) → cpointer? vec : s32vector?
syntax
(_s32vector mode maybe-len)
_s32vector
procedure
(make-u32vector len) → u32vector?
len : exact-nonnegative-integer? (u32vector val ...) → u32vector? val : (integer-in 0 4294967295) (u32vector? v) → boolean? v : any/c (u32vector-length vec) → exact-nonnegative-integer? vec : u32vector? (u32vector-ref vec k) → (integer-in 0 4294967295) vec : u32vector? k : exact-nonnegative-integer? (u32vector-set! vec k val) → void? vec : u32vector? k : exact-nonnegative-integer? val : (integer-in 0 4294967295) (list->u32vector lst) → u32vector? lst : (listof (integer-in 0 4294967295)) (u32vector->list vec) → (listof (integer-in 0 4294967295)) vec : u32vector? (u32vector->cpointer vec) → cpointer? vec : u32vector?
syntax
(_u32vector mode maybe-len)
_u32vector
procedure
(make-s64vector len) → s64vector?
len : exact-nonnegative-integer? (s64vector val ...) → s64vector? val : (integer-in -9223372036854775808 9223372036854775807) (s64vector? v) → boolean? v : any/c (s64vector-length vec) → exact-nonnegative-integer? vec : s64vector? (s64vector-ref vec k) → (integer-in -9223372036854775808 9223372036854775807) vec : s64vector? k : exact-nonnegative-integer? (s64vector-set! vec k val) → void? vec : s64vector? k : exact-nonnegative-integer? val : (integer-in -9223372036854775808 9223372036854775807) (list->s64vector lst) → s64vector? lst : (listof (integer-in -9223372036854775808 9223372036854775807)) (s64vector->list vec) → (listof (integer-in -9223372036854775808 9223372036854775807)) vec : s64vector? (s64vector->cpointer vec) → cpointer? vec : s64vector?
syntax
(_s64vector mode maybe-len)
_s64vector
procedure
(make-u64vector len) → u64vector?
len : exact-nonnegative-integer? (u64vector val ...) → u64vector? val : (integer-in 0 18446744073709551615) (u64vector? v) → boolean? v : any/c (u64vector-length vec) → exact-nonnegative-integer? vec : u64vector? (u64vector-ref vec k) → (integer-in 0 18446744073709551615) vec : u64vector? k : exact-nonnegative-integer? (u64vector-set! vec k val) → void? vec : u64vector? k : exact-nonnegative-integer? val : (integer-in 0 18446744073709551615) (list->u64vector lst) → u64vector? lst : (listof (integer-in 0 18446744073709551615)) (u64vector->list vec) → (listof (integer-in 0 18446744073709551615)) vec : u64vector? (u64vector->cpointer vec) → cpointer? vec : u64vector?
syntax
(_u64vector mode maybe-len)
_u64vector
procedure
(make-f32vector len) → f32vector?
len : exact-nonnegative-integer? (f32vector val ...) → f32vector? val : real? (f32vector? v) → boolean? v : any/c (f32vector-length vec) → exact-nonnegative-integer? vec : f32vector? (f32vector-ref vec k) → real? vec : f32vector? k : exact-nonnegative-integer? (f32vector-set! vec k val) → void? vec : f32vector? k : exact-nonnegative-integer? val : real? (list->f32vector lst) → f32vector? lst : (listof real?) (f32vector->list vec) → (listof real?) vec : f32vector? (f32vector->cpointer vec) → cpointer? vec : f32vector?
syntax
(_f32vector mode maybe-len)
_f32vector
procedure
(make-f64vector len) → f64vector?
len : exact-nonnegative-integer? (f64vector val ...) → f64vector? val : real? (f64vector? v) → boolean? v : any/c (f64vector-length vec) → exact-nonnegative-integer? vec : f64vector? (f64vector-ref vec k) → real? vec : f64vector? k : exact-nonnegative-integer? (f64vector-set! vec k val) → void? vec : f64vector? k : exact-nonnegative-integer? val : real? (list->f64vector lst) → f64vector? lst : (listof real?) (f64vector->list vec) → (listof real?) vec : f64vector? (f64vector->cpointer vec) → cpointer? vec : f64vector?
syntax
(_f64vector mode maybe-len)
_f64vector
procedure
(make-f80vector len) → f80vector?
len : exact-nonnegative-integer? (f80vector val ...) → f80vector? val : extflonum? (f80vector? v) → boolean? v : any/c (f80vector-length vec) → exact-nonnegative-integer? vec : f80vector? (f80vector-ref vec k) → extflonum? vec : f80vector? k : exact-nonnegative-integer? (f80vector-set! vec k val) → void? vec : f80vector? k : exact-nonnegative-integer? val : extflonum? (list->f80vector lst) → f80vector? lst : (listof extflonum?) (f80vector->list vec) → (listof extflonum?) vec : f80vector? (f80vector->cpointer vec) → cpointer? vec : f80vector?
syntax
(_f80vector mode maybe-len)
_f80vector