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

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


Am Samstag, den 01.05.2021, 01:11 +1000 schrieb Julien Fischer:
> Hi,
> 
> On Fri, 30 Apr 2021, Volker Wysk wrote:
> 
> > 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.
> 
> "pred" in the mode declaration requires parentheses for arity zero
> predicates, e.g. it should be:
> 
>     :- mode issat((pred) is semidet, out) is det.
> 
> > issat(Pred, Issat) :-
> >    ( if Pred then Issat = yes
> >              else Issat = no
> >    ).

Thanks!

> (The standard library contains a function providing the above,
> bool.pred_to_bool/2.)

Okay.


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/b880bea2/attachment.sig>


More information about the users mailing list