[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Name That Class!

Your first example is right.  But there is a mistaken assumption in your
second example that throws all the others off.  Specifically, you say

                                 It seems that (DEFLCASS FOO ...)
    is equivalent to

       (let ((c (make-instance 'standard-class))) (setf
        (<various aspects> c) <certain values>) (setf (class-named
        'foo) c) c)

But this isn't right.  (defclass foo ...) is equivalent to:

(let* ((existing (class-named 'foo t))
       (new (if existing
                (class-for-redefinition existing)
                (make-instance 'standard-class))))
  (setf (class-named 'foo) new)
  (update-class new ..)

Given this clarification, its clear that (for instances of
standard-class) the rest of your examples should return:

2. T
3. T
4. T

The point is that class-named has no smarts (remember that as much as
possible we don't want to do things that just couldn't map into a
Lisp-1, and certainly set! has no smarts).  class-for-redefinition is
where all the smarts is.