Subject: Re: [SWIPL] arithmetic_function

From: Jan Wielemaker <[email-masked]>
Date: Mon, 16 Jul 2001 21:01:17 +0200

> I got a similar error when using arithmetic functions:
> 
> ? - X is some_function(2).
> X = 8
> 
> ? - 5 < some_function(2).
> ERROR: Arithmetic: `some_function/1' is not a function
> 
> Could somebody tell me why?

Yip.  It is a bug.  Just patched it in the CVS version (get
pl/src/pl-ext.c for the patch).  Basically, >, <, etc. are
not meta-predicates as is/2, making them search for the
registered arithmetic function in the system module.

As a work around you can use:

:- arithmetic_function(system:some_function/1).

system:some_function(X, Y) :-
	Y is 4*X.

	Thanks --- Jan