Advice could be the easiest way to do it. Writing your own comparisons
in Java would be complicated and in Jess it would be quite hard to do
a whole set (since you'd need to use the functions you were
replacing). Advice would be pretty simple. I think this is all you'd
need to do:
(defadvice before (list < > <= >= = <>)
(if (or (eq nil (nth$ 2 ?argv)) (eq nil (nth$ 3 ?argv))) then
(return FALSE)))
On Jun 18, 2008, at 1:28 PM, [EMAIL PROTECTED] wrote:
I have a case where I have a User Function that typcally returns a
Number but can return NIL. If I have a rule that uses the >
function, I get a "Not a number" exception. I'd like to handle this
in the SQL NULL sort of way, which is to say, NIL cannot be compared
to anything successfully (i.e. it is not less than, greater than, or
equal to any other number, including NIL).
I could do this through function "advice" or I could write my own
comparison operators. Does anyone have other suggestions?
-Russ
---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------