13.17 The vector type

append($x$)
The append($x$) method appends the number $x$ to a vector and returns the new vector.

extend($x$)
The extend($x$) method appends the members of a list or vector $x$ to the operand and returns the new vector.

filter($f$)
The filter($f$) method takes a pointer to a function of one argument, $f(a)$. It calls the function for every element of the vector, and returns a new vector of those elements for which $f(a)$ tests true.

insert($n,x$)
The insert($n,x$) method inserts the number $x$ into a vector at position $n$, and returns the new vector.

len()
The len() method returns the number of elements in a vector.

list()
The list() method returns the elements in a vector as a list.

map($f$)
The map($f$) method takes a pointer to a function of one argument, $f(a)$. It calls the function for every element of the vector, and returns a vector of the results.

norm()
The norm() method returns the quadrature sum of the elements in a vector.

reduce($f$)
The reduce($f$) method takes a pointer to a function of two arguments. It first calls $f(a,b)$ on the first two elements of the vector, and then continues through the vector calling $f(a,b)$ on the result and the next item in the vector. The final result is returned.

reverse()
The reverse() method reverses the order of the elements of a vector, and returns the new vector.

sort()
The sort() method sorts the elements of a vector into ascending order, and returns the new vector.