#3 assert to take a variable bound to a fact shape

CLIPS
closed
nobody
None
5
2013-08-30
2009-02-12
David Holz
No

I'm passing fact shapes in to CLIPS to be asserted later, but find no way of performing (assert ?f)

Here's the scenario:

(candidate-fact (fact (foo (x 1) (y 2))))

(defrule apply-candidate
?f <- (candidate-fact (fact ?shape))
(...whatever other predicates...)
=>
(assert ?shape) ; NOPE!
(retract ?f))

Discussion

  • Gary Riley
    Gary Riley
    2009-05-05

    Define the interior fact attribute as a string: (candidate-fact (fact "(foo (x 1) (y 2))"))
    Then use (str-assert ?shape) rather than (assert ?shape)

     
  • Gary Riley
    Gary Riley
    2013-08-30

    • status: open --> closed
    • Group: --> CLIPS