Pattern-matchng over vectors works when the vector is fully populated.
Trying to access an element in an index which has not been assigned a value raises
an error. Note vector destructuring in this way is slow and the facility is not often used.
This example non-destructively double every element in a vector.