Sha256: bbcc7d80ac3d2f2e547721df9b924c77d970a5eecce7b583788bb80da1092e7a
Contents?: true
Size: 1.05 KB
Versions: 5
Compression:
Stored size: 1.05 KB
Contents
(examples-for accum ("accumulate the values passed to a given function and return the list" (accum a (a 1) (a 2) (a 3)) (1 2 3)) ("accum function returns the accumulated object in each case" (let watcher nil (let accumulated (accum b (= watcher (cons (b 1) watcher)) (= watcher (cons (b 2) watcher)) (= watcher (cons (b 3) watcher))) (list 'watcher watcher 'accumulated accumulated))) (watcher (3 2 1) accumulated (1 2 3)))) (examples-for accum-hash ("accumulate the values passed to a given function under the given key, return the resulting hash" (let h (accum-hash hi (hi 'a 1) (hi 'a 2) (hi 'b 42) (hi 'b 43) (hi 'a 3) (hi 'b 44) (hi 'c 'x) (hi 'a 4) (hi 'c 'y) (hi 'c 'z)) (list h.a h.b h.c)) ((4 3 2 1) (44 43 42) (z y x))))
Version data entries
5 entries across 5 versions & 1 rubygems