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]
--------------------------------------------------------------------