Subject: Re: QUESTION ON PRECEDENCE

From: Lionel Ains <[email-masked]>
Date: Thu, 11 May 2000 12:59:47 GMT+1

> -------Message d'origine-------
> De : "Politini, Cohen" <[email-masked]>
> Date : 11/05/100 00:13:48
> 
> Can someone please help me with this. Say I want to allow 
 "+" to be done
> first before " * " in the equation :
> 
> X is  A + B*C.
> 
The best way to do it would be

?- op(550, yfx, *).

Then you will have the following result:

?- X is 10+5*2.

X = 30

Yes

You have a description of the operator default 
precedences in the SWI-Prolog manual (Appendix B.3).
Be careful because this will change the way Prolog 
interprets all you calculations!

Lionel

______________________________________________________
Boîte aux lettres - Caramail - http://www.caramail.com