vector-map

Name

vector-map -- Maps a function over a vector

Type: function

Synopsis

vector-map( proc vec, result);

Arguments

proc

An instance of <function>.

vec

An instance of <vector>.

Return Values

result

An instance of <vector>.

Description

This function is to vectors what map is to lists.

The length of result is the minimum of the lengths of the vec arguments. Hence, if one of vec is an empty vector (having 0 length), then an empty vector is returned and proc is never called.

(define x '#(1 2 3))

(define y '#(10 20 30))

(vector-map + x y) #(11 22 33)

(define z '#(8 9))

(vector-map + y z) #(18 19)