A sad state of affairs, isn't it? This is the kind of mess that drove
me to make the changes I did in this area between versions 5 and 6. I
think in version 6 we've finally got things right.
Anyway, the problem here is that what ?type-module is in Jess 5.2 is a
jess.Value of type RU.FACT_ID. The FACT_ID type just holds an integer,
but it's not the same as plain old integer. A similarly confusing
duality exists in CLIPS, and that's where Jess originally inherited
the concept from. findFactByID (which is being called by the
implementation of fact-slot-value) wants a plain old integer. So you
have to convert it manually:
(printout t (fact-slot-value (integer ?type-module) sorte) crlf)
Again, note that this whole explanation applies to Jess 5.2 only. it
does NOT apply to the 6.x series, where what you have written below
would be correct.
I think Ryan G. Beckes (Home) wrote:
> Hello,
>
> The code below works fine in JESS 6.0a6, but I cannot use a non-stable
> release.
>
> I'm looking into fact-slot-value as a solution. I attempted to use the
> code below, which are from another users message. Basically this returns a
> "No overloading of method 'findFactByID'" error.
>
> I also tried Ernest Friedman-Hill's scriptlib.clp fix (i.e. at this page.
> http://www.mail-archive.com/[email protected]/msg02596.html)
> This returns an "Not an external address: "<Fact-2>"" error, which leads
> me to believe this fix was aimed at 6.0a* users.
>
> Is this a bug with JESS 5.2, or am I doing something wrong?
>
> Thanks,
> Ryan
>
>
>
>
>
> ---clips file
> (deftemplate type-module
> (slot module)
> (slot sorte)
> )
>
> (defrule init
> =>
> (load-facts "y.dat")
> )
>
> (defrule blah
> ?type-module <- (type-module (module FXINT))
> =>
> (printout t (fact-slot-value ?type-module sorte) crlf)
> )
>
> -----data file (y.dat)
> (type-module (module FXINT) (sorte CP))
> (type-module (module FXINT) (sorte CPCP))
>
>
>
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [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 (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------