Next: , Previous: Slots, Up: Slots


3.1 Slot Descriptors

Slots are represented by slot descriptors, which are data structures providing information about the slots, such as their name. Slot descriptors are stored inside of classes, and may be retrieved from there and subsequently inspected.

— Procedure: class-slots class

Returns a list of the slot descriptors for class. This contains all slots for class, both direct slots and inherited slots. The returned value must not be modified.

— Procedure: class-slot class name error?

Returns the slot descriptor for the slot named name in class. If there is no such slot: if error? is #f, returns #f, otherwise signals an error of type condition-type:no-such-slot.

— Procedure: slot-descriptor? object

Returns #t if object is a slot descriptor, otherwise returns #f.

— Procedure: slot-name slot

Returns the name of slot.

— Procedure: slot-class slot

Returns the class of slot. This is the class with which slot is associated. This is not necessarily the class that defines slot; it could also be a subclass of that class. If the slot was returned from class-slots or class-slot, then this class is the argument passed to that procedure.

— Procedure: slot-properties slot

Returns an alist of the properties of slot. This list must not be modified.

— Procedure: slot-property slot name default

If slot has a property named name, it is returned; otherwise default is returned.

— Procedure: slot-initial-value? slot

Returns #t if slot has an initial value, and #f otherwise. The initial value is specified by the initial-value slot property when a class is made.

— Procedure: slot-initial-value slot

Returns the initial value for slot, if it has one; otherwise it returns an unspecified value. The initial value is specified by the initial-value slot property when a class is made.

— Procedure: slot-initializer slot

Returns the initializer for slot; the initializer is specified by the initializer slot property when a class is made. This is a procedure of no arguments that is called to produce an initial value for slot. The result may also be #f meaning that the slot has no initializer.