chickadee » srfi-217 » iset-fold

iset-fold proc nil isetprocedure
iset-fold-right proc nil isetprocedure

Invokes proc on each member of iset in increasing/decreasing numerical order, passing the result of the previous invocation as a second argument. For the first invocation, nil is used as the second argument. Returns the result of the last invocation, or nil if there was no invocation.

Examples:

   (iset-fold + 0 (iset 2 3 5 7 11)) ⇒ 28
   (iset-fold cons '() (iset 2 3 5 7 11)) ⇒ (11 7 5 3 2)
   (iset-fold-right cons '() (iset 2 3 5 7 11)) ⇒ (2 3 5 7 11)