Hello Alex,
now via email to document it:
(be retract (@CL)
(2 cons (-> @CL))
(@ retract (list (car (-> @CL)) (cdr (-> @CL)))) )
Your hint on IRC with the different matching schemes of call and retract
were the gotcha! Unfortunately I couldn't use the new 'call' predicate,
as it would need a level of '3' then :-( So I inlined it ...
The above works nicely:
(? (assertz (foo (1))))
(? (assertz (foo (2))))
(? (assertz (foo (3))))
(? (assertz (foo (1 1))))
(? (assertz (foo (2 2))))
(? (assertz (foo (3 3))))
(be retract (@CL)
(2 cons (-> @CL))
(@ retract (list (car (-> @CL)) (cdr (-> @CL)))) )
(? (retract (foo @N)))
@N=1
@N=2.
(? (retract (foo @N @C)))
@N=1 @C=1
@N=2 @C=2.
(rules 'foo)
1 (be foo (3))
2 (be foo (3 3))
:-))))) May I propose to add this predicate to pilog.l in a future
release? :-)
Thanks again and good night,
Cle :-)
PS: But I still does not understand, why there is a '2' for the level
necessary. A '1' should be enough, or does '1' mean current level? But
then, what does '0' mean? :-/
--
UNSUBSCRIBE: mailto:[email protected]?subject=unsubscribe