[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Name That Class!
- To: common-lisp-object-system@SAIL.STANFORD.EDU
- Subject: Name That Class!
- From: Dick Gabriel <RPG@SAIL.STANFORD.EDU>
- Date: 01 Sep 87 1258 PDT
It would be nice if it turned out that the relationship between
a class and its name could be as clean as the relationship between
a symbol and its value, but this is not the case: We can already
ask of a class its name.
When I wrote these examples I thought of two parallel activities going
on in two CLOS's right next to each other - one in which a user was using
DEFCLASS to build up a hierarchy and one in which a user was using
anonymous classes to build up the same hierarchy. My assumption about the
equivalence of DEFCLASS and the LET-expression was derived from a belief
that simplicity of model was desirable.
I don't, now, believe that the behaviors I listed in my message are alarming
(though I did originally) because one can imagine a Common Lisp in which
(defun f (...)...)
and
(setf (symbol-function 'f) (function (lambda (...)...)))
are equivalent and similar behaviors hold to the ones in that message (that
is, SETF of SYMBOL-FUNCTION is smart).
We also run into the problem that Common Lisp already treats types as a
sort-of subclass of SYMBOL, and so the tight name-to-object mapping
described in my message is not altogether out of line with an attempt to
integrate classes with types.
We haven't really talked about what DEFCLASS is equivalent to yet,
so I suppose there are now two proposals as to what that might be on
the table.
-rpg-