tasks a-s

This commit is contained in:
Ingy döt Net 2013-04-10 23:57:08 -07:00
parent 47bf37c096
commit b83f433714
12433 changed files with 156208 additions and 123 deletions

View file

@ -0,0 +1,23 @@
(defclass point ()
((x :initarg :x :initform 0 :accessor x)
(y :initarg :y :initform 0 :accessor y)))
(defclass circle (point)
((radius :initarg :radius :initform 0 :accessor radius)))
(defgeneric shallow-copy (object))
(defmethod shallow-copy ((p point))
(make-instance 'point :x (x p) :y (y p)))
(defmethod shallow-copy ((c circle))
(make-instance 'circle :x (x c) :y (y c) :radius (radius c)))
(defgeneric print-shape (shape))
(defmethod print-shape ((p point))
(print 'point))
(defmethod print-shape ((c circle))
(print 'circle))
(let ((p (make-instance 'point :x 10))
(c (make-instance 'circle :radius 5)))
(print-shape p)
(print-shape c))