[mercury-users] =/2 used as a goal, not as an expression
Goncalo Jorge Coelho e Silva
l10454 at alunos.uevora.pt
Mon May 26 11:37:05 AEST 2003
(sorry about the message flood today ;) )
Ralph wrote:
>> inter.m:094: error: the language construct =/2 should be
>> inter.m:094: used as a goal, not as an expression.
>> inter.m:094: If you are trying to use a goal as a boolean function,
>> inter.m:094: you should write `if <goal> then yes else no' instead.
>> make: *** [run] Error 1
>
>The error message seems very clear.
Not to me I'm affraid. I tried to write the `if <goal> then yes else no'
code suggestion but 'yes' and 'no' come up as "error: undefined predicate
`yes/0'"
Besides, I find no problem with this simple condition, for it to be
considered a goal:
...
lookup(RegistHashIn, "mode") = ModeIn,
(
if {ModeIn = 0} then
%unify(Xi,S)
{io__write_string(" Update Unify - unify_value ")}
else
array__set(HeapIn, H, Xi, HeapOut),
NewH = H + 1,
set(RegistHashIn, "h", NewH) = RegistHash01
),
...
Thanks,
Goncalo
--------------------------------------------------------------------------
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