On Mon, Feb 9, 2009 at 4:39 PM, Henrique Lopes Cardoso <[email protected]> wrote:
> Yes, you're right.
> Then, you have two options:
> a) wait for the cleaning task to become active:
>
> (defrule retract-them-all
> (cleaning-time)
> ?x <- (MappingName)
> =>
> (rectract ?x))
For a successful repeat performance you'll have to devise a way of getting
rid of the (cleaning-time) fact after it has fulfilled its purpose for the
first time. ("The Moor has done his duty, the Moor can go.") Otherwise it'll
be just as obnoxious as the rule without this CE - just a litlle later.
> b) Create a function to do it and invoke it when needed:
>
> (defquery get-them-all
> ?f <- (MappingName))
>
> (deffunction retract-them-all ()
> (bind ?result (run-query* get-them-all))
> (while (?result next)
> (retract (?result get f)) ) )
>
Right, but why program (remove) when it is already there?
-W
> Cheers,
>
> Henrique
>
>