Now that we know how to create classes, access slots, and define methods, it might be useful to verify that everything is doing ok. To help with this a plethora of predicates have been created.
Return the class that symbol represents.
If there is no class,
nil is returned if errorp is
If errorp is non-
wrong-argument-type is signaled.
t if class is a valid class object.
class is a symbol.
nil if object-or-class has slot.
nil if OBJECT’s slot is bound.
Setting a slot’s value makes it bound. Calling slot-makeunbound will
make a slot unbound.
object can be an instance or a class.
Return the class name as a symbol.
Return the value in CLASS of a given OPTION. For example:
(class-option eieio-default-superclass :documentation)
Will fetch the documentation string for
Return a string of the form ‘#<object-class myobjname>’ for obj.
This should look like Lisp symbols from other parts of Emacs such as
buffers and processes, and is shorter and cleaner than printing the
object’s record. It is more useful to use
object-print to get
an object’s print form, as this allows the object to add extra display
information into the symbol.
Returns the class symbol from obj.
Returns the symbol of obj’s class.
Returns the direct parents class of class. Returns
it is a superclass.
eieio-class-parents except it is a macro and no type checking
Deprecated function which returns the first parent of class.
Return the list of classes inheriting from class.
eieio-class-children, but with no checks.
t if obj’s class is the same as class.
t if obj inherits anything from class. This
is different from
same-class-p because it checks for inheritance.
t if child is a subclass of class.
method-symbol is a generic function, as
opposed to a regular Emacs Lisp function.