18 CLOS compatibility

Currently, the following functions should behave almost as expected from CLOS.

defclass

All slot keywords are available but not all work correctly. Slot keyword differences are:

:reader, and :writer tags

Create methods that signal errors instead of creating an unqualified method. You can still create new ones to do its business.

:accessor

This should create an unqualified method to access a slot, but instead pre-builds a method that gets the slot’s value.

:type

Specifier uses the typep function from the cl package. See Type Predicates in Common Lisp Extensions. It therefore has the same issues as that package. Extensions include the ability to provide object names.

defclass also supports class options, but does not currently use values of :metaclass, and :default-initargs.

make-instance

Make instance works as expected, however it just uses the EIEIO instance creator automatically generated when a new class is created. See Making New Objects.

cl-defgeneric

Creates the desired symbol, and accepts most of the expected arguments of CLOS’s defgeneric.

cl-defmethod

Accepts most of the expected arguments of CLOS’s defmethod. To type cast against a class, the class must exist before cl-defmethod is called.

cl-call-next-method

Works just like CLOS’s call-next-method.

CLOS supports the describe command, but EIEIO provides support for using the standard describe-function command on a constructor or generic function.

When creating a new class (see Building Classes) there are several new keywords supported by EIEIO.

In EIEIO tags are in lower case, not mixed case.