chickadee » srfi-1 » pair-for-each

pair-for-each f clist_1 clist_2 ...procedure

Like for-each, but F is applied to successive sublists of the argument lists. That is, F is applied to the cons cells of the lists, rather than the lists' elements. These applications occur in left-to-right order.

The F procedure may reliably apply set-cdr! to the pairs it is given without altering the sequence of execution.

(pair-for-each (lambda (pair) (display pair) (newline)) '(a b c)) ==>
    (a b c)
    (b c)
    (c)

At least one of the list arguments must be finite.