[m-dev.] for review: new predicates in map.m

Tyson Dowd trd at cs.mu.OZ.AU
Tue Oct 20 11:54:31 AEST 1998


On 20-Oct-1998, Andrew Bromage <bromage at cs.mu.OZ.AU> wrote:
> G'day all.
> 
> Zoltan Somogyi wrote:
> 
> > +	% Given a map, return a list of all the keys in the map,
> > +	% in sorted order.
> > +:- pred map__sorted_keys(map(K, _V), list(K)).
> > +:- mode map__sorted_keys(in, out) is det.
> 
> There are already parts of the compiler which assume that map__keys/2
> returns the keys in sorted order.  (I know because I wrote one or two
> of them; after asking, of course. <g>)  Perhaps it would be better to
> make that the default behaviour of map__keys/2.

Well, maybe.  That's one way of fixing the bugs.

But it's inconsistent with our normal scheme of using the word
"sorted" to indicate sorted, which "" indicates nothing.
While will lead to further bugs.

-- 
Those who would give up essential liberty to purchase a little temporary
safety deserve neither liberty nor safety.     - Benjamin Franklin

Tyson Dowd   <tyson at tyse.net>   http://tyse.net



More information about the developers mailing list