[m-users.] Syntax error at token 'is': operator precedence error

Volker Wysk post at volker-wysk.de
Sat May 1 01:01:06 AEST 2021


Hi.

I'm trying to define a predicate, which takes another predicate of arity 0
as its first argument:

:- pred issat(pred, bool).
:- mode issat(pred is semidet, out) is det.

issat(Pred, Issat) :-
    ( if Pred then Issat = yes
              else Issat = no
    ).


I get this error:

test.m:030: Syntax error at token 'is': operator precedence error.


Why? It works for arity > 0, but how to define it for arity 0?

Cheers,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20210430/4b008ce4/attachment.sig>


More information about the users mailing list