List comprehensions for Lisp

I have implemented a similar feature in Common Lisp. Besides lists, my implementation also handles arbitrary sequences (such as arrays), hash tables and multidimensional arrays.

For example, this list comprehension

(collect (list) ((* x x)) (in (x) '(1 2 3 4 5 6 7 8)))

(1 4 9 16 25 36 49 64)

(1 2 3 4 5 6 7 8))

Adding a when-clause to the list comprehension filters the result:

(collect (list) ((* x x)) (in (x) '(1 2 3 4 5 6 7 8)) (when (= (mod x 2) 0)))

(4 16 36 64),

Download source code. This source should run on all Common Lisp systems

Documentation. A description of what you can express using list comprehensions, with a few examples.

A paper.

Examples. More examples.

FAQ.. Answers to some questions.

The source can also be read on-line.