[m-dev.] For review: small change to map.m and tree234.m
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Sep 12 22:32:23 AEDT 2000
On 12-Sep-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> Estimated hours taken: 1.1
>
> tree234__keys/2 returns its keys in sorted order. This is a very
> handy property, but not documented. This change rectifies the
> situation.
...
> library/tree234.m:
> Renamed tree234__keys as tree234__sorted_keys.
> Added tree234__keys as a synonym.
I think the best way to rectify the situation is simply to document
that tree234__keys is guaranteed to return the keys in sorted order.
(This is already documented in the source code for map.m, as it
happens, but it should be documented in the proper place, namely in
the interface for tree234.m.)
For tree234, ordering is a fundamental invariant of the data
structure, and one that is inherent in the name "tree234".
I can't imagine any good reason why it would ever make sense
for tree234__keys to return the keys in non-sorted order.
So I don't see any need to have two different predicates
`keys' and `sorted_keys' in tree234.
> library/map.m:
> Added map__sorted_keys.
That part of the log message is not true.
map__sorted_keys already existed.
The change to map.m was just to call tree234__sorted_keys
rather than tree234__keys.
--
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