Node:Handling Slot Access Errors, Previous:Class Slots, Up:Accessing Slots



3.4.3 Handling Slot Access Errors

GOOPS calls one of the following generic functions when a "slot-ref" or "slot-set!" call specifies a non-existent slot name, or tries to reference a slot whose value is unbound.

slot-missing generic
slot-missing (class <class>) slot-name method
slot-missing (class <class>) (object <object>) slot-name method
slot-missing (class <class>) (object <object>) slot-name value method
When an application attempts to reference or set a class or instance slot by name, and the slot name is invalid for the specified class or object, GOOPS calls the slot-missing generic function.

The default methods all call goops-error with an appropriate message.

slot-unbound generic
slot-unbound (object <object>) method
slot-unbound (class <class>) slot-name method
slot-unbound (class <class>) (object <object>) slot-name method
When an application attempts to reference a class or instance slot, and the slot's value is unbound, GOOPS calls the slot-unbound generic function.

The default methods all call goops-error with an appropriate message.