Node:SRFI-4 - Procedures, 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.

TAGvector? obj Scheme Procedure
Return #t if obj is a homogeneous numeric vector of type TAG.

make-TAGvector n [value] Scheme Procedure
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.

TAGvector value1 ... Scheme Procedure
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.

TAGvector-length TAGvec Scheme Procedure
Return the number of elements in TAGvec.

TAGvector-ref TAGvec i Scheme Procedure
Return the element at index i in TAGvec.

TAGvector-ref TAGvec i value Scheme Procedure
Set the element at index i in TAGvec to value. The return value is not specified.

TAGvector->list TAGvec Scheme Procedure
Return a newly allocated list holding all elements of TAGvec.

list->TAGvector lst Scheme Procedure
Return a newly allocated homogeneous numeric vector of type TAG, initialized with the elements of the list lst.