:do

[syntax] :do (lb ...) ne1? (ls ...)

[syntax] :do (let (ob ...) oc ...) (lb ...) ne1? (let (ib ...) ic ...) ne2? (ls ...)

SRFI-42: Defines a generator in terms of a named-let, optionally decorated with inner and outer lets. This generator is for defining other generators. The generator is a compromise between expressive power (more flexible loops) and fixed structure (necessary for merging and modifying generators). In the fully decorated form, the syntactic variables ob (outer binding), oc (outer command), lb (loop binding), ne1? (not-end1?), ib (inner binding), ic (inner command), ne2? (not-end2?), and ls (loop step) define the following loop skeleton:

(let (ob ...)
  oc ...
  (let loop (lb ...)
    (if ne1?
        (let (ib ...)
          ic ...
          payload
          (if ne2?
              (loop ls ...) ))))),

where oc ... and ic ... are syntactically equivalent to command ..., i.e. they do not begin with a definition. The latter requirement allows the code generator to produce more efficient code for special cases by removing empty let-expressions altogether.