It follows the form of the mathematical set-builder notation (set comprehension) as distinct from the use of map and filter functions.
List with all the doubles from 0 to 10 (exclusive) List with the names of the customers based in Rio de Janeiro The previous code is syntactic sugar for the following code written using lambda expressions: Filtering numbers divisible by 3: Multiple "generators": An infinite lazy sequence: A list comprehension using multiple generators: List comprehensions can be expressed with the loop macro's collect keyword.
Conditionals are expressed with if, as follows: List the names of customers: List the customers with balances: List the names of customers with balances: The general forms: Note that by putting the condition and expression after the variable name and enumerable object, editors and IDEs can provide autocompletion on the members of the variable.
Lazily-evaluated sequences: Or, for floating point values Lists and arrays: List comprehensions are the part of a greater family of language constructs called computation expressions.
An example with multiple generators: Using the for-comprehension: List comprehensions are supported in Scheme through the use of the SRFI-42 library.