This is an old revision of the document!
List comprehensions are used for creating lists from existing lists and other iterable structures. List comprehensions typically follow formatting similar to set-builder notation in discrete mathematics.
The following defines the set of all squares, n2 such that n is an integer and n is in the range 0..9: {n2 | n ∈ Z ∧ 0 ≤ n ≤ 9 }.