[m-dev.] [Q] structure reuse across module boundrys

Peter Ross petdr at miscrit.be
Thu Sep 21 05:22:56 AEDT 2000


Nancy and I have structure reuse working inside one module but not
completely across module boundrys.

For example, if we have the following code defined in another module:
    
:- pred p(list(T)::in, list(T)::in, list(T)::in) is semidet.

p(X, Y, Z) :-
        % no reuse because the first arg to list__append is alised with
        % the second arg.
    list__append(X, X, Z),

        % reuse providing X and Y aren't possibly aliased.
    list__append(X, Y, Z).

We need to generate the following highlevel code

p(X, Y, Z) :-
    list:append(X, X, Z),
    list:Reuse__append(X, Y, Z).

What is the best way to inform the compiler that whenever I see a call
to list__append which can have reuse applied to call list:Reuse__append?

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