Previous: , Up: srfi ilists procs   [Index]


2.40.6.15 Iteration thunks

Iteration thunks are procedures accepting no arguments and returning an item from a collection; when the iteration finishes: the return value is the void object. Iteration thunks can be used with the facilities of the library (vicare containers iteration-thunks) (see iteration thunks).

Function: make-ilist-iteration-thunk ell

Return an iteration thunk for the objects in the proper immutable list ell.

(define (xcons a b)
  (cons b a))

(iteration-thunk-fold xcons
  '()
  (make-ilist-iteration-thunk (ilist 0 1 2 3 4)))
⇒ (4 3 2 1 0)