[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. CLOS compatibility

As you read this, it is important to know that I have just recently learned some of the CLOS syntax, but have never used it myself outside of the EIEIO framework. I'm primarily and Emacs Lisp hacker who wrote EIEIO to help myself learn some of the mechanics of Object Oriented programming.

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

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

:reader, and :writer tags
Create methods that throw errors instead of creating an unqualified method. You can still create new ones to do its business.
This should create an unqualified method to access a slot, but instead pre-builds a method that gets the slot's value.
Specifier uses the typep function from the `cl' package. @xref{(cl)Type Predicates}. 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 works as expected, however it just uses the EIEIO instance creator automatically generated when a new class is created. See section 5. Making New Objects.
Creates the desired symbol, and accepts all of the expected arguments except :AROUND.
Calls defgeneric, and accepts most of the expected arguments. Only the first argument to the created method may be type cast, though any argument can be syntactically type cast. (And promptly ignored) To type cast against a class, the class must exist before defmethod is called. In addition, the :AROUND tag is not supported.
Inside a method, calls the next available method up the inheritance tree for the given object. This is different than that found in CLOS because in EIEIO this function accepts replacement arguments. This permits subclasses to modify arguments as they are passed up the tree. If no arguments are given, the expected CLOS behavior is used.
If the common-lisp subsystem is loaded, the setf parameters are also loaded so the form (setf (slot-value object slot) t) should work.

CLOS supports the describe command, but eieio only provides eieio-describe-class, and eieio-describe-generic. These functions are adviced into describe-variable, and describe-function.

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

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

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs Webmaster on October, 2 2007 using texi2html