Next: , Previous: , Up: srfi eager-comp spec   [Index]


2.22.4.2 Qualifiers

This section defines the syntax qualifier. The nesting of qualifiers is from left (outer) to right (inner). In other words, the rightmost generator spins fastest. The nesting also defines the scope of the variables introduced by the generators. This implies that inner generators may depend on the variables of outer generators. The sequence of enumeration of values is strictly depth first. These conventions are illustrated by the first example.

The syntax qualifier consists of the following alternatives.

Qualifier: generator

Enumerate a sequence of bindings of one or more variables. The scope of the variables starts at the generator and extends over all subsequent qualifiers and expressions in the comprehension. srfi eager-comp spec generators.

Qualifier: if test

Filters the sequence of bindings by testing if test evaluates to non–#f. Only for those bindings for which this is the case, the subsequent qualifiers of the comprehension are evaluated.

Qualifier: not test
Qualifier: and test*
Qualifier: or test*

Abbreviated notations for filters of the form (if (not test)), (if (and test*)), and (if (or test*)). These represent frequent cases of filters.

Qualifier: begin sequence

Evaluate sequence, consisting of command* expression, once for each binding of the variables defined by the previous qualifiers in the comprehension. Using this qualifier, side effects can be inserted into the body of a comprehension.

Qualifier: nested qualifier*

A syntactic construct to group qualifiers. The meaning of a qualifier according to the nested syntax is the same as inserting qualifier* into the enclosing comprehension. This construct can be used to reduce comprehensions with several qualifiers into a form with exactly one qualifier.


Next: , Previous: , Up: srfi eager-comp spec   [Index]