12.1 eieio-instance-inheritor

This class is defined in the package eieio-base.

Instance inheritance is a mechanism whereby the value of a slot in object instance can reference the parent instance. If the parent’s slot value is changed, then the child instance is also changed. If the child’s slot is set, then the parent’s slot is not modified.

Class: eieio-instance-inheritor parent-instance

A class whose instances are enabled with instance inheritance. The parent-instance slot indicates the instance which is considered the parent of the current instance. Default is nil.

To use this class, inherit from it with your own class. To make a new instance that inherits from and existing instance of your class, use the clone method with additional parameters to specify local values.

The eieio-instance-inheritor class works by causing cloned objects to have all slots unbound. This class’ slot-unbound method will cause references to unbound slots to be redirected to the parent instance. If the parent slot is also unbound, then slot-unbound will signal an error named slot-unbound.