[m-rev.] Added unsafe_promise_unique/1 func
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Dec 19 11:45:39 AEDT 2001
On 19-Dec-2001, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> On rechecking my change, I observed that I omitted to include a clause
> for unsafe_promise_unique/1 - it is odd that this wasn't spotted by the
> compiler since it passed bootcheck...
>
> Having added the following:
...
> % unsafe_promise_unique/2 is a compiler builtin.
> +
> +unsafe_promise_unique(X) = Y :-
> + unsafe_promise_unique(X, Y).
>
> compilation of the library now halts with
> builtin.m:825: Warning: clause for builtin.
>
> This is wrong, surely? unsafe_promise_unique/*2* is the compiler
> builtin.
Nah, they're both builtin.
The code to handle builtins just checks the number of arguments
after functions have been converted to predicates.
> Can someone give me a pointer as to what I need to do to fix matters?
Delete the clause for unsafe_promise_unique/1 and
delete the "/2" in the comment saying it is a builtin.
> > There should also be a test case.
>
> Well, unsafe_promise_unique/2 is called from
> hard_coded/unused_float_box_test.m; is there any need for a separate
> test case involving unsafe_promise_unique/1?
IMHO yes, to check that the code for builtins handles it correctly.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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