[m-rev.] diff: fix bugs in smart recompilation
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Jul 24 23:50:37 AEST 2001
On 24-Jul-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
>
> +:- func item_is_unchanged(item, item) = bool.
> +
> + % We don't need to compare the varsets. What matters is that
> + % the variable numbers in the arguments and body are the same,
> + % the names are irrelevant.
Hmm, that looks wrong to me. Maybe you're not aware of the following sentence
from the Mercury language reference manual:
| The scope of type variables in a predicate or function's type
| declaration extends over any explicit type qualifications in the
| clauses for that predicate or function, so explicit type qualifications
| can refer to those type variables.
So if, for example, you write
:- module example.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
main --> foo(0, "").
:- pred foo(T1, T2, io__state, io__state).
:- mode foo(in, in, di, uo) is det.
foo(_, _) -->
io__read(R `with_type` io__read_result(T1)),
io__print(R),
io__nl.
and then you change the pred declaration for `foo' to
:- pred foo(T2, T1, io__state, io__state).
then the resulting program will behave differently.
Could you please add this one as a test case?
I think the code for smart recompilation will also need to be
changed to make it work...
--
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