(defclass coloured ()
(colour))
(defclass coloured-circle (circle coloured)
())
(defclass rectangle ()
(height width))
(defclass circle ()
(radius))
(defvar r)
(defmethod area-r ((r rectangle))
(* (slot-value r 'height)
(slot-value r 'width)))
(defvar c)
(defmethod area-c ((c circle))
(* pi (expt (slot-value c 'radius) 2)))
(let ((r (make-instance 'rectangle)))
(setf (slot-value r 'height) 2
(slot-value r 'width) 3)
(area-r r))
(let ((c (make-instance 'circle)))
(setf (slot-value c 'radius) 4)
(area-c c))
(defvar cc)
(let ((cc (make-instance 'coloured-circle)))
(setf (slot-value cc 'radius) 9)
(area-c cc))
CL-USER> (defvar cc)
CC
CL-USER> (let ((cc (make-instance 'coloured-circle)))
(setf (slot-value cc 'radius) 9)
(area-c cc))
254.46900494077323d0
CL-USER> (type-of cc)
; Evaluation aborted on #<UNBOUND-VARIABLE CC {100460B1B3}>. ->
какова техника поиска, что я проморгал?