next up previous

9.3.3.5 Inheritance Propagation Facet

An inherit facet says that a slot in a class can be given to instances of other classes that inherit from the first class. This is the default. The no-inherit facet says that only direct instances of this class will get the slot.

Example

CLIPS> (clear)
CLIPS>
(defclass A (is-a USER)
    (role concrete)
    (slot foo (propagation inherit))
    (slot bar (propagation no-inherit)))
CLIPS> (defclass B (is-a A))
CLIPS> (make-instance a of A)
[a]
CLIPS> (make-instance b of B)
[b]
CLIPS> (send [a] print)
[a] of A
(foo nil)
(bar nil)
CLIPS> (send [b] print)
[b] of B
(foo nil)
CLIPS>


next up previous