Next: , Previous: , Up: lists fold   [Index]


23.8.2 Folding with R6RS style

Exactly as with the fold-left and fold-right functions defined by R6RS:

Syntax: fold-left/stx combine knil circ1 circ2 ...
Syntax: fold-right/stx combine knil circ1 circ2 ...

Like fold-left and fold-right, defined by R6RS, but implemented as syntaxes. These syntaxes exist only for completeness.

Function: fold-left* combine knil circ1 circ2 ...
Function: fold-right* combine knil circ1 circ2 ...
Syntax: fold-left*/stx combine knil circ1 circ2 ...
Syntax: fold-right*/stx combine knil circ1 circ2 ...

Like fold-left and fold-right, defined by R6RS, but accept lists of different length and stop at the end of the shortest list. At least one of the list arguments must be finite. The syntaxes may be a little faster than the functions when multiple circ arguments are involved.