Extending the Class System

It is nice to extend object-oriented programming to apply to ordinary Lisp objects.

An easy way to do this is by making the function class-of return the Lisp type-of data that are not instance objects.

Once basic Lisp data have classes, it is possible to overload operators and include basic data in the object system:


(defmethod + ((self string) ss)
  (concatenate 'string self ss))

Contents    Page-10    Prev    Next    Page+10    Index