[m-dev.] for review: lower bound and upper bound searching

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Mar 6 19:16:22 AEDT 1999


On 05-Mar-1999, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> Add predicates to perform lower-bound and upper-bound searching, in which
> if a search for a key fails, we return the next lower (or higher) key and
> its associated value.

That looks fine.  Just one comment:

> +:- pred report_lookup_error(string, K, V).
> +:- mode report_lookup_error(in, in, unused) is erroneous.
> +
> +%	report_lookup_error(Message, Key, Value)
> +%		Abort with an error that is message appropriate for
> +%		the failure of a lookup operation, which either did not find
> +%		what it expected to find or found something it did not expect
> +%		to find.

I suggest that you replace that with

%		Call error/1 with an error message that is appropriate for
%		the failure of a lookup operation involving the specified
%		Key and Value.  The error message will include Message and
%		information about Key and Value.

-- 
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.



More information about the developers mailing list