Lisp HUG Maillist Archive

Clarification of KW's CONTEXT goal

Hi. I want to confirm that our understanding of the CONTEXT goal is correct.

In a sample app, we see the following behavior:

1. A rule RHS has a (context) goal that pushes a new context onto the stack.

2. This rule completes firing.

3. All remaining activations in the present context fire.

4. Activations in the context pushed in step (1) fire.

If our observations are correct, I admit being surprised by step (3). Based
on my experiences with other shells, I expected to have the rule in (1)
complete firing, then the new context made current and its activations fire,
then "control" return to the "calling context". But, if that's how KW
behaves, fine. I just want to make sure I understand this correctly.

Thanks for the enlightenment...

Cheers,

David E. Young
Bloodhound Software, Inc.

For wisdom is more precious than rubies,
and nothing you desire can compare with her.
  -- Prov. 8:11

"But all the world understands my language."
  -- Franz Josef Haydn (1732 - 1809)



This email message is for the sole use of the intended recipients(s) and may contain confidential and privileged information of Bloodhound Software, Inc.. Any unauthorized review, use, disclosure is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.


Re: Clarification of KW's CONTEXT goal

Young, David wrote:

>Hi. I want to confirm that our understanding of the CONTEXT goal is correct.
>
>In a sample app, we see the following behavior:
>
>1. A rule RHS has a (context) goal that pushes a new context onto the stack.
>
>2. This rule completes firing.
>
>3. All remaining activations in the present context fire.
>
>4. Activations in the context pushed in step (1) fire.
>
>If our observations are correct, I admit being surprised by step (3). Based
>on my experiences with other shells, I expected to have the rule in (1)
>complete firing, then the new context made current and its activations fire,
>then "control" return to the "calling context". But, if that's how KW
>behaves, fine. I just want to make sure I understand this correctly.
>
>Thanks for the enlightenment...
>
>
>
>  
>

Hi,

KW could be seen as following its doc and popping contexts from the top 
of the stack once it has finished its current context. Just because you 
have pushed a new context doesn't mean that the current context has 
necessarily finished. If you want to implement the behaviour you want 
you can (return) from the current context immediately after pushing the 
new context.

That said, KW was somewhat patterned off other shells. It should 
probably do what the de facto standard is or at least have a context 
option where for doing that.

>"But all the world understands my language."
>  -- Franz Josef Haydn (1732 - 1809)
>
>  
>

Ahem. We don't use the F-word here! :-j

__Jason


Updated at: 2020-12-10 08:55 UTC