Product Site

A.2.4. Repetitive Loops over Suppliers

A supplier loop specifies one or two control variables, index, and item, which receive a different value on each repetition of the loop. (For more information on index and item, see Section 2.4, “DO”.) These different values are taken from successive values of supplier. The supplier is any expression that evaluates to an object that provides a supplier method. The supplier returned determines the set of values and their order.

All values for the loop iteration are obtained at the beginning of the loop. Therefore, changes to the target object do not affect the loop iteration.

If you want to specify a name on the END clause or on an ITERATE or LEAVE instruction, you have to specify the LABEL keyword.
Example A.8. LOOP WITH over a supplier
loop with index name item method over .numericComparator~methods(.nil)
  say name method~isPrivate method~isProtected method~isGuarded
end

This example can produce:
COMPARE 0 0 1
INIT 0 0 1