chickadee » srfi-225 » dict-fold

dict-fold dto proc knil dictprocedure

Invokes proc on each association of dict with three arguments: the key of the association, the value of the association, and an accumulated result of the previous invocation. For the first invocation, knil is used as the third argument. Returns the result of the last invocation, or knil if there was no invocation. Note that there is no guarantee of a consistent result if the dictionary does not have an inherent order.

(dict-fold dto + 0 '((1 . 2) (3 . 4))) ⇒ 10