Je lis dans this répondre SO qu'il estCLIPS accès à une propriété d'une propriété
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
Et si je veux accéder à la propriété d'un bien immobilier? Par exemple,
donné deux instances a
et b
des classes A
et B
, respectivement.
a
a une propriété appelée ref_to_b
qui est une référence à b
. b
a une propriété appelée some_prop_of_b
.
Comment puis-je correspondre à ce qui suit:
a
avec ref_to_b
égal à b
et some_prop_of_b
égal à "some_string".
J'ai essayé mais nous avons eu une erreur:
(defrule my_rule "comment me"
(object (is-a A)
(ref_to_b ?ref_to_b))
(?ref_to_b
(some_prop_of_b "some_string"))
=>
)
Ah la nom du logement. C'était la clé. – stackoverflowwww