Next: loops comprehensions string, Previous: loops comprehensions do, Up: loops comprehensions [Index]
The list of values obtained by evaluating expression once for each binding in the sequence defined by the qualifiers. If there are no qualifiers the result is the list with the value of expression.
(list-ec ;no qualifiers 1) ⇒ (1) (list-ec (:range i 4) ;i from 0 to 3 i) ⇒ (0 1 2 3) (list-ec (:range n 3) (:range k (+ n 1)) (list n k)) ⇒ ((0 0) (1 0) (1 1) (2 0) (2 1) (2 2))
The list obtained by appending all values of expression, which must all be lists. Think of it as:
(apply append (list-ec ?qualifier ... expression))
Examples:
(append-ec ;no qualifiers '(a b)) ⇒ (a b) (append-ec (:range i 0) ;loops zero times '(a b)) ⇒ '() (append-ec (:range i 1) '(a b)) ⇒ (a b) (append-ec (:range i 2) '(a b)) ⇒ '(a b a b)