John,

Thanks for the report. Module support is new in Jess 6.0, so a few bugs
are being shaken out.  There are calls to setCurrentModule() on lines
568 and 704 of jess/Rete.java which are causing the problem you're
observing. Delete these two lines and the problem goes away.


I think John R. Callahan wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> I have a problem with defrule failing to define a rule within the
> current defmodule "scope" if the RHS of the rule asserts new
> facts with explicitly module names.  Here are two examples
> that differ only in their use of implicit and explicit facts (creating
> new deftemplates of course):
> 
> =============== Example 1 ==================
> Jess, the Java Expert System Shell
> Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
> Jess Version 6.0 12/7/2001
> 
> Jess> (defmodule A)
> TRUE
> Jess> (get-current-module)
> A
> Jess> (defrule R1
>         (initial-fact)
> =>
>         (assert (foo bar)) ; IMPLICIT declaration of deftemplate A::foo
> )
> TRUE
> Jess> (get-current-module)
> A
> Jess>
> ============= End Example 1 =================
> 
> And now using an EXPLICIT module name...
> 
> =============== Example 2 ==================
> Jess, the Java Expert System Shell
> Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
> Jess Version 6.0 12/7/2001
> 
> Jess> (defmodule A)
> TRUE
> Jess> (get-current-module)
> A
> Jess> (defrule R1
>         (initial-fact)
> =>
>         (assert (MAIN::foo bar)) ; EXPLICIT declaration of deftemplate MAIN::foo
> )
> TRUE
> Jess> (get-current-module)
> MAIN
> Jess>
> =============== END Example 2 ============
> 
> Shouldn't the current module still be A?  Perhaps this problem
> was solved by a patch or I misunderstand the use of current
> module.
> 
> Thanks...
> 
> -- jack
> 
> 
> John R. Callahan, Ph.D.
> CTO
> Sphere Software Corporation - The Intelligence of XML
> 9250 Bendix Road North
> Columbia, MD 21045
> [EMAIL PROTECTED]
> 410-480-7301
> 410-598-2157 (cell)
> 509-352-1536 (eFax)
> 
> 
> 
> --------------------------------------------------------------------
> 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]
--------------------------------------------------------------------

Reply via email to