Next: Application of associative lists
Up: Associative Lists in A++
Previous: Associative Lists in A++
Contents
Index
The following examples show how a list of keys and a corresponding list
of values can be combined into one associative list of pairs using
the abstraction `map2', an extension of `map'.
To display an associative list using symbols as keys a new function is required,
because `ldisp!' can handle only Church Numerals. We call this new function
`aldisp!'.
To search for keys in the list we need another lambda abstraction,
which we call `assoc'.
This example uses the following extensions of A++ in its original
version:
- defnition of symbols using the `single-quote'-character,
- use of the primitive function `equalx'
for comparing general objects.
- use of the primitive function `print' to display the
results.
Next: Application of associative lists
Up: Associative Lists in A++
Previous: Associative Lists in A++
Contents
Index
Georg P. Loczewski
2004-03-05