First, I would not use defadvice. If you call assert in the "second" module,
you won't want to add the argument to the linked list. I *think* that event
handling would be more appropriate, even though this might mean that you'll
have to write some Java code.

You write that you want to repeat all assert, modify and retract calls in
the "second" module. It seems that you'll want to have the facts in that
second module to be a copy of the ones in the "first" module. If that is so,
what is the purpose of this exercise? Saving facts so that they can be
safely restored later on can be achieved easier by, e.g., calling
save-facts.

I hate to give advice without understanding what the other guy is trying to
do; discussing things on a mere technical basis is (mostly) a waste of
time...

Cheers
Wolfgang

On Thu, Dec 4, 2008 at 12:57 PM, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I have two modules that are similar. The rules are fired on one module and
> there facts are asserted, modified and retracted. Based on some value
> these actions need to performed on the second module. I thought it might
> be a good idea to approach it in this way:
>
> (defglobal ?*acts* = (new LinkedList))
>
> (defadvice before assert
>        (?*acts* add $?argv)
> )
>
> (deffunction makeithappen ( )
>        (foreach ?a ?*acts*
>         ; call the action
>        )
> )
>
> In words, I store all the actions in the acts list whenever assert is
> called. Then, the function makeithappen calls all the functions again, but
> then on the second module. How can I do this? Or is there another way?
>
> Regards,
> Nick.
>
>
>
>
> --------------------------------------------------------------------
> 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