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

Re: new version of PCL



    Date: 14 Mar 88 14:59 PST (Monday)
    From: stanonik@nprdc.arpa (Ron Stanonik)

    I just ftp'ed pcl from parcvax and it wouldn't compile until
    I fiddled with canonicalize-slot-specification in defclass.

I changed this to use LIST and LIST* instead of doubly nested
backquotes.  (I didn't want to try to figure out whether I was right
about how doubly nested ,@ works or KCL was right).

Try the following, it should work just as well for you.

The reason why I have to use list like this, and the reason the
backquotes were doubly nested is to make the hack that reduces the
number of initfunctions work.  Specifically, if you do something like:

(defclass foo ()
    ((x *init*)
     (y *init*)))

it will expand into:

(let ((#:g1 #'(lambda () *init*)))
 (load-defclass
    .
    .
    (list (list :name 'x :initfunction #:g1 :initform '*init*) 
          (list :name 'y :initfunction #:g1 :initform '*init*))
    .
    .))

The point is that it uses the same initfunction over if possible.

;from defclass.lisp
(defun canonicalize-slot-specification (class-name spec)
  (cond ((symbolp spec)
	 `'(:name ,spec))
	((null (cdr spec))
	 `'(:name ,(car spec)))
	((null (cddr spec))
	 (warn "In DEFCLASS ~S, the slot specification ~S is obsolete.~%~
                Convert it to ~S"
	       class-name spec (list (car spec) :initform (cadr spec)))
	 `(list :name ',(car spec)
		:initform ',(cadr spec)
		:initfunction ,(make-initfunction (cadr spec))))
	(t
	 (let* ((name (pop spec))
		(unsupplied (list nil))
		(initform (getf spec :initform unsupplied)))
	   (if (eq initform unsupplied)
	       `(list* :name ',name ',spec)
	       `(list* :name ',name
		       :initfunction ,(make-initfunction initform)
		       ',spec))))))
-------