Next: loops comprehensions arith, Previous: loops comprehensions string, Up: loops comprehensions [Index]
The vector of all values of expression. Think of it as:
(list->vector (list-ec ?qualifier ... expression))
Examples:
(vector-ec ;no qualifiers 1) ⇒ (vector 1) (vector-ec (:range i 0) i) ⇒ (vector) (vector-ec (:range i 1) i) ⇒ (vector 0) (vector-ec (:range i 2) i) ⇒ (vector 0 1)
The vector of all values of expression, of which there must be
exactly k. This comprehension behaves like vector-ec
but
can be implemented more efficiently.
(vector-of-length-ec 1 1) ⇒ (vector 1) (vector-of-length-ec 0 (:range i 0) i) ⇒ (vector) (vector-of-length-ec 1 (:range i 1) i) ⇒ (vector 0) (vector-of-length-ec 2 (:range i 2) i) ⇒ (vector 0 1)