Maybe I get it now.  There are two ways for the MAIN module to have focus;
either explicitly via (reset) or (focus MAIN), or by default via popping the
focus stack to empty.  The watch facility does not distinguish between the
two and so popping an explicit MAIN off the top of the focus stack does not
register as a change in focus due to the implicit MAIN at the bottom of any
focus stack.  Do I have this right?

On Jan 27, 2008 8:35 PM, Ernest Friedman-Hill wrote:

> On Jan 27, 2008, at 5:54 PM, D Moon wrote:
> >
> > The rules behave as I expect and want now, but I have a follow-on
> > question about (watch all), which (as I understand) shows all
> > module focus changes.  Although one can clearly see that MAIN has
> > focus when "FIRE 1 MAIN::lose-an-item" occurs below, there was no
> > "==> Focus MAIN" watch output line that would explicitly show when
> > precisely the focus change occurs.  I believe that the focus change
> > to MAIN must have occurred between the (item) fact assertion and
> > the subsequent (run).
>
> No, MAIN already had the focus; (reset) gives the focus to MAIN. In
> general, there's no output from "watch" for things that happen during
> (reset).
>
> > Perhaps related, there is what I consider to be a stray/misplaced
> > "==> Focus MAIN" output line at the end.  I speculate that it is
> > out of order because my final call to (get-focus-stack) shows an
> > empty focus stack, which does not correspond with the previous
> > output line that indicates the MAIN module would be on (the top of)
> > the focus stack:
>
> When all the rules in MOD have fired, MOD is popped off the focus
> stack and MOD loses the focus. The focus stack is then empty, so MAIN
> gets the focus by default.

Reply via email to