Previous: , Up: loops generators   [Index]


1.16.4.9 Conditional generators

Generator Syntax: :while ?generator expression

Run ?generator while expression evaluates to true. The guarding expression is included in the region of the variables introduced by the generator.

Note the distinction between the filter if and the modified generator expressed by :while.

Generator Syntax: :until ?generator expression

Run ?generator until after expression has evaluated to true. The guarding expression is included in the region of the variables introduced by the generator.

Note the distinction between :while, stopping at a certain condition, and :until, stopping after a certain condition has occurred. The latter implies that the binding that has triggered termination has been processed by the comprehension.