Content deleted Content added
→Objective-C (Cocoa/GNUstep): copy editing and (crudely) referencing |
→OCaml: copy editing and linking |
||
Line 1,128:
</syntaxhighlight>
===
The [[OCaml]] programming language provides three different associative containers. The simplest is a list of pairs:
<syntaxhighlight lang=OCaml>
Line 1,158:
</syntaxhighlight>
The code above uses OCaml's default hash function <code>Hashtbl.hash</code>, which is defined automatically for all types.
Finally, functional maps (represented as immutable balanced binary trees):
Line 1,173:
</syntaxhighlight>
Note that in order to use <code>Map</code>, you have to provide the functor <code>Map.Make</code> with a module which defines the key type and the comparison function. The third-party library ExtLib provides a polymorphic version of functional maps, called
Lists of pairs and functional maps both provide a purely functional interface.
=== [[OptimJ]] ===
|