Please see the following sequence of actions that leads to some possibly unexpected behavior:
CLIPS> (get-current-module)
MAIN
CLIPS> (assert (f 1))
<Fact-1>
CLIPS> (facts)
f-1 (f 1)
For a total of 1 fact.
CLIPS> (defmodule FOO)
CLIPS> (list-focus-stack)
MAIN
CLIPS> (defrule do-it (f ?f) => (focus MAIN) (assert (f ?f)))
CLIPS> (assert (f 2))
<Fact-2>
CLIPS> (facts)
f-2 (f 2)
For a total of 1 fact.
CLIPS> (run)
CLIPS> (get-current-module)
FOO
CLIPS> (facts)
f-2 (f 2)
For a total of 1 fact.
CLIPS> (list-focus-stack)
CLIPS> (pop-focus)
FALSE
CLIPS> (focus MAIN)
TRUE
CLIPS> (facts)
f-1 (f 1)
For a total of 1 fact.
CLIPS> (list-focus-stack)
MAIN
CLIPS> (pop-focus)
MAIN
CLIPS> (list-focus-stack)
CLIPS> (get-current-module)
MAIN
What's the unexpected behavior in this example?