| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gauche.dictionary - Dictionary framework A dictionary is an abstract class for objects that can map a key to a value. This module provides some useful generic functions for dictionaries.
<dictionary>) proc seed
Calls a procedure proc over each entry in a dictionary dict, passing a seed value. Three arguments are given to proc; an entry's key, an entry's value, and a seed value. Initial seed value is seed. The value returned from proc is used for the seed value of the next call of proc. The result of the last call of proc is returned from dict-fold.
If dict is <ordered-dictionary>, proc is called
in the way to keep the following associative order, where
the key is ordered from K0 (minimum) to Kn (maximum), and
the corresponding values is from V0 to Vn:
(proc Kn Vn (proc Kn-1 Vn-1 ... (proc K0 V0 seed))) |
<ordered-dictionary>) proc seed
Like dict-fold, but the associative order of applying proc
is reversed as follows:
(proc K0 V0 (proc K1 V1 ... (proc Kn Vn seed))) |
This generic function is only defined on <ordered-dictionary>.
<dictionary>) proc
Calls proc with a key and a value of every entry in the dictionary dict. For ordered dictionaries, proc is guaranteed to be called in the increasing order of keys.
<dictionary>) proc
Calls proc with a key and a value of every entry in the dictionary dict, and gathers the result into a list and returns it. For ordered dictionaries, the result is in the increasing order of keys (it doesn't necessarily mean proc is called in that order).
<dictionary>)
<dictionary>)
Returns a list of all keys or values of a dictionary dict, respectively. For ordered dictionaries, the returned list is in the increasing order of keys.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Shiro Kawai on October, 7 2008 using texi2html 1.78.