| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Class <vector> inherits <sequence> and
you can use various generic functions such as map and fold
on it. See section 9.3 gauche.collection - Collection framework, and See section 9.18 gauche.sequence - Sequence framework.
If you keep only a homogeneous numeric type, you may be able
to use SRFI-4 homogenous vectors (See section 10.4 srfi-4 - Homogeneous vectors).
#t if obj is a vector, #f otherwise.
With gauche.collection module,
you can also use a method size-of.
By default, vector-ref signals an error if k is
negative, or greater than or equal to the length of vector.
However, if an optional argument fallback is given,
it is returned for such case. This is an extension of Gauche.
With gauche.sequence module,
you can also use a method ref.
With gauche.sequence module, you can also use
a setter method of ref.
The optional start and end argument of vector->list
limits the range of the vector to be retrieved.
(vector->list '#(1 2 3 4 5)) => (1 2 3 4 5) (list->vector '(1 2 3 4 5)) => #(1 2 3 4 5) (vector->list '#(1 2 3 4 5) 2 4) => (3 4) |
With gauche.collection module, you can use
(coerce-to <list> vector) and
(coerce-to <vector> list) as well.
Optional start and end limits the range of effect between start-th index (inclusive) to end-th index (exclusive). Start defaults to zero, and end defaults to the length of vector. These optional arguments are Gauche's extension.
(vector-copy '#(1 2 3 4 5)) => #(1 2 3 4 5) (vector-copy '#(1 2 3 4 5) 2 4) => #(3 4) |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |