[m-dev.] for review: two useful additions to map.m

Fergus Henderson fjh at cs.mu.OZ.AU
Mon May 29 23:43:50 AEST 2000


On 29-May-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> 
> Added two functions to the map module that I often end up having to
> code elsewhere.
> 
> library/map.m
>         Added func map__add_to_list(Map, K, V).  V is consed onto the
>         list value mapped to by K in Map (if such a mapping exists)
>         or the mapping for K is set as [V] (otherwise).
> 
>         Added func map__add_to_set(Map, K, V) which is similar to the
>         above, except that the value type for the mapping is set/1
>         and the corresponding operations are set__insert/2 and
>         set__make_singleton_list/1 respectively.

Hmm... isn't that what `multi_map' is for?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list