|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
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.
find-classwill have the same effect.
nilis returned if errorp is
nilif class is a class type.
nilif obj is an object.
nilif obj-or-class contains slot in its class.
nilif 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.
(class-option eieio-default-superclass :documentation)
Will fetch the documentation string for
object-printto get and object's print form, as this allows the object to add extra display information into the symbol.
object-classexcept this is a macro, and no type-checking is performed.
nilif it is a superclass.
class-parentexcept it is a macro and no type checking is performed.
class-children, but with no checks.
tif obj's class is the same as class.
same-class-pexcept this is a macro and no type checking is performed.
tif obj inherits anything from class. This is different from
same-class-pbecause it checks for inheritance.
tif child is a subclass of class.
method-symbolis a generic function, as opposed to a regular emacs list function.
It is also important to note, that for every created class, a two
predicates are created for it. Thus in our example, the function
data-object-p is created, and return
t if passed an object
of the appropriate type. Also, the function
is created which returns
t if the object passed to it is of a
type which inherits from
|[ << ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
Conform with <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html40/loose.dtd">
Automatically validated by PSGML