Previous: SRFI-4 - Read Syntax, Up: SRFI-4


39.5.2 SRFI-4 Procedures

The procedures listed in this section are provided for all homogeneous numeric vector datatypes. For brevity, they are not all documented, but a summary of the procedures is given. In the following descriptions, you can replace TAG by any of the datatype indicators u8, s8, u16, s16, u32, s32, u64, s64, f32 and f64.

For example, you can use the procedures u8vector?, make-s8vector, u16vector, u32vector-length, s64vector-ref, f32vector-set! or f64vector->list.

— Scheme Procedure: TAGvector? obj

Return #t if obj is a homogeneous numeric vector of type TAG.

— Scheme Procedure: make-TAGvector n [value]

Create a newly allocated homogeneous numeric vector of type TAG, which can hold n elements. If value is given, the vector is initialized with the value, otherwise, the contents of the returned vector is not specified.

— Scheme Procedure: TAGvector value1 ...

Create a newly allocated homogeneous numeric vector of type TAG. The returned vector is as long as the number of arguments given, and is initialized with the argument values.

— Scheme Procedure: TAGvector-length TAGvec

Return the number of elements in TAGvec.

— Scheme Procedure: TAGvector-ref TAGvec i

Return the element at index i in TAGvec.

— Scheme Procedure: TAGvector-ref TAGvec i value

Set the element at index i in TAGvec to value. The return value is not specified.

— Scheme Procedure: TAGvector->list TAGvec

Return a newly allocated list holding all elements of TAGvec.

— Scheme Procedure: list->TAGvector lst

Return a newly allocated homogeneous numeric vector of type TAG, initialized with the elements of the list lst.