chickadee » transducers » reverse-mapping-fold

reverse-mapping-fold f sentinel mappingprocedure

Like mapping-fold, but folds over the keys in reverse-order.

 
(import (only (srfi 128)
              make-default-comparator)
        (srfi 146)
        transducers)

(transduce mapping-fold
           values
           (collect-list)
           (mapping (make-default-comparator)
                    'a 1
                    'b 2
                    'c 3
                    'd 4))

; => ((d . 4) (c . 3) (b . 2) (a . 1))