Reimplement and document ldict-reduce.
This commit is contained in:
parent
90fa195dc5
commit
6a35b94f34
2 changed files with 16 additions and 5 deletions
11
doc/utils.md
11
doc/utils.md
|
@ -121,6 +121,17 @@ Returns a new dictionary containing only key/value pairs matching the
|
|||
given predicate. The procedure ```pred?``` must accept two arguments -
|
||||
the key and the value.
|
||||
|
||||
(ldict-reduce init proc ld)
|
||||
|
||||
* ```init``` - initial accumulator value
|
||||
* ```proc``` - accumulating procedure
|
||||
* ```ld``` - a ldict instance
|
||||
|
||||
Performs a reduce operation on the pairs of given dictionary using
|
||||
```init``` as initial accumulator. The accumulating procedure must
|
||||
accept three arguments: the value accumulated so far, the key and the
|
||||
value.
|
||||
|
||||
### IO
|
||||
|
||||
(import util-io)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue