Subject: Re: operators

From: Paul Sephton <[email-masked]>
Date: Thu, 11 May 2000 17:38:25 +0200 (GMT+0200)

Spoilsport!

On Thu, 11 May 2000, Lionel Ains wrote:

> > -------Message d'origine-------
> > De : "Politini, Cohen" <[email-masked]>
> > Date : 11/05/100 04:58:20
> >=20
> > I want to declare an operator 'c', so I wrote
> >=20
> > :-op(1000,yfx,c).
> >=20
> > Then now I want to say that the 'c' in NcR represents=20
> something like
> >=20
> > operator c =3D ((N+N) - R)*R.
> >=20
> > Cansomeone help me ??
> 
> Then you should add to your program:
> 
> :- arithmetic_function(c/2).
> c(N, R, Result):-
>   Result is (((N + N) - R) * R).
> 
> (see chapter 3.28 of the SWI-Prolog manual for details).
> 
> And the ?- X is (10 c 45).
> Should be interpreted correctly.
> Note: ?- X is (10c45) won't work because Prolog will then=20
> read 10c45 as one atom.
> 
> Lionel
> 
> ______________________________________________________
> Bo=EEte aux lettres - Caramail - http://www.caramail.com
> 
> 

_____________________________________________________________________________
Paul Sephton ([email-masked])                               INET Development
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ever wondered if jumping out of the frying pan might actually be refreshing?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~