[mercury-users] Problem with: Different clauses for different modes

Tyson Dowd trd at cs.mu.OZ.AU
Wed Sep 26 02:08:00 AEST 2001


Which version of the Mercury compiler are you using?

0.10.x doesn't support this feature, only the release of the day (ROTD).

----- Original Message -----
From: "Ondrej Bojar" <oboj7042 at ss1000.ms.mff.cuni.cz>
To: <mercury-users at cs.mu.OZ.AU>
Sent: Tuesday, September 25, 2001 5:16 PM
Subject: [mercury-users] Problem with: Different clauses for different modes


> Hi.
>
> When trying to compile a predicate with different clauses for different
> modes, I get this error:
>
> dagorunify.m:140: In clause for predicate `dagorunify:unifies/2':
> dagorunify.m:140:   in argument 1 of clause head:
> dagorunify.m:140:   error: undefined symbol `::/2'.
> dagorunify.m:140: In clause for predicate `dagorunify:unifies/2':
> dagorunify.m:140:   in argument 1 of clause head:
> dagorunify.m:140:   in argument 2 of functor `::/2':
> dagorunify.m:140:   error: undefined symbol `in/0'.
> ...and so on for every :: used in the declaration clause.
>
> Is something wrong with my code?
>
> % Just test, whether the two fs fit together
> % if only one fs is given, then it copies it to the other.
> :- pred unifies(fs, fs).
> :- mode unifies(in, in) is semidet.
> :- mode unifies(out, in) is det.
> :- mode unifies(in, out) is det.
>
> :- pragma promise_pure(unifies/2).
>
> unifies((FSA::in), (FSB::in)) :-
>   cc_unify(FSA, FSB, _Result).
> unifies(FSA::out, FSB::in) :- FSA = FSB.
> unifies(FSA::in, FSB::out) :- FSA = FSB.
>
> (:- pred cc_unify(fs::in, fs::in, fs::out) is semidet.)
>
> Thanks for help,
>   Andrew.
>
> --------------------------------------------------------------------------
> mercury-users mailing list
> post:  mercury-users at cs.mu.oz.au
> administrative address: owner-mercury-users at cs.mu.oz.au
> unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message:
unsubscribe
> subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
> --------------------------------------------------------------------------
>

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list