[m-rev.] New library module: default_map.m

Ralph Becket rbeck at microsoft.com
Wed Jul 11 22:53:54 AEST 2001


> From: Fergus Henderson [mailto:fjh at cs.mu.OZ.AU]
> Sent: 11 July 2001 13:30
> 
> Hmm... how about just adding a variant of map__search/map__lookup
> that takes a default?

Yeah, that would work too :)

> I've needed map__lookup_with_default often enough, but I don't think
I've ever
> needed to store the default in the map.

It seemed the right place to put the default.  Augmenting every lookup
call with the default value looks like a source of bugs to me.  If you
feel strongly, though, I shan't argue - I suspect most places where I've
wanted this functionality have been fairly localized, so using augmented
lookups shouldn't be too bad.

- Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list