0
better to explicitly retrieve the slot value by matching it rather than using the slot accessor as this will cause the condition to be reevaluated whenever the slot value changes
如果我想访问一个属性的属性?例如,
分别给出了分别为A
和B
的a
和b
的两个实例。
a
有一个名为ref_to_b
的属性,它是对b
的引用。 b
有一个属性some_prop_of_b
。
如何匹配以下:
a
与ref_to_b
等于b
和some_prop_of_b
等于 “some_string”。
我试过,但得到了一个错误:
(defrule my_rule "comment me"
(object (is-a A)
(ref_to_b ?ref_to_b))
(?ref_to_b
(some_prop_of_b "some_string"))
=>
)
阿名称插槽。这是关键。 – stackoverflowwww