No subject

hanberg at ruc.dk hanberg at ruc.dk
Tue Jul 20 06:34:19 AEST 2004


Hi

I'm trying to run the following code, but keep getting the same error. proveble2
gets a list of expressions and proveable returns an int given an expression and
an int.

:- pred proveable2(list(expr(T)), io__state, io__state).
:- mode proveable2(in, ui, uo) is det.

proveable2([Head|Tail], IO_In, IO_Out) :- if proveable(Head, 4, INT) then
print(INT, IO_In, IO_Out), proveable2(Tail, IO_In, IO_Out) else
io__write_string("test", IO_In, IO_Out).

proveable2([], IO_In, IO_Out) :- print(0, IO_In, IO_Out).

I keep getting the following error.

filereader2.m:072: In clause for `proveable2(in, ui, uo)':
filereader2.m:072:   in argument 2 of call to predicate `io:print/3':
filereader2.m:072:   unique-mode error: the called procedure would clobber
filereader2.m:072:   its argument, but variable `IO_In' is still live.
For more information, try recompiling with `-E'.

I don't really know why that is. everything is deterministic except the
proveable procedure. I hope someone can help me.

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