I really don't know what you were trying to do here. If the birthdate
facts look like
(birthdate "11-Apr-1964")
or some such, then your rules can just look like
(defrule age_in_year_Rule
(birthdate ?bithd)
=>
(assert (age_in_year (date-calls "YEARS_SINCE" ?bithd))))
I think [EMAIL PROTECTED] wrote:
>
> Hello!
> I am trying to upgrade from Jess 3.2 to 4.1. I am having trouble
> converting with some userfunctions I wrote for dates. I have some rules
> like:
>
> (defrule age_in_year_Rule
> (declare (salience 40))
> (birthdate ?bithd)
> =>
> (assert (age_in_year (date-calls "YEARS_SINCE" "%birthdate%")))
> )
>
> (defrule age_in_month_Rule
> (declare (salience 40))
> (birthdate ?bithd)
> =>
> (assert (age_in_month (date-calls "MONTHS_SINCE" "%birthdate%")))
> )
>
> In the userfunction, I get the value of the fact (birthdate) using the
> rete.facts vector and calculate the requested value for return. In the
> new rete there is no facts vector. There is a m-facts vector, which my
> complier says is not accessible from my implements Userfunction. There
> is also a factList that returns a string.
> It has been while since I wrote the rules, so I can't recall why
> date-calls is invoked with the fact name rather than the fact value,
> which would eliminate the need to get the fact value in the function.
> What Jess syntax could I use to pass the value of fact "birthdate"
> rather than the name?
>
> Any ideas?
>
> Thanks
> Christo
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list. List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
>
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9214 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------