[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: arithmetic functions
From: |
Jorge M. Pelizzoni |
Subject: |
RE: arithmetic functions |
Date: |
Mon, 10 Feb 2003 11:50:14 -0300 |
Here is a way round your problem, which should comply with any Prolog.
Notice that any expression that is evaluated through 'is'/2 is handled
equally by 'my_is'/2.
Cheers,
Jorge.
> -----Original Message-----
> From: address@hidden
[mailto:users-
> address@hidden On Behalf Of Jeff
Koster
> Sent: Friday, February 07, 2003 8:55 PM
> To: address@hidden
> Subject: arithmetic functions
>
> Hi,
>
> Does anyone know of a way to implement arithmetic functions in
gprolog?
> I'm
> porting over from SWI which allows:
> -------
> :- op(25,xf,[minutes]).
> :- arithmetic_function(minutes/1).
> minutes(M,S) :-
> S is M * 60.
> -------
> enabling me to use 'minutes' as a function, for example:
> ?- Time is 3 minutes.
> would produce
> Time = 180
>
> The efficiency of these particular operators is not of major
importance in
> my
> application.
>
> Thanks in advance,
> J.
>
>
> _______________________________________________
> Users-prolog mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/users-prolog
my_is.pro
Description: Binary data