home *** CD-ROM | disk | FTP | other *** search
- ; book pp.199-200
-
- (defproto point-proto '(x y) '() compound-data-proto)
-
- (defmeth point-proto :x (&optional (x nil set))
- (if set (setf (slot-value 'x) x))
- (slot-value 'x))
-
- (defmeth point-proto :y (&optional (y nil set))
- (if set (setf (slot-value 'y) y))
- (slot-value 'y))
-
- (defmeth point-proto :isnew (x y)
- (send self :x x)
- (send self :y y))
-
- (defmeth point-proto :data-length () 2)
- (defmeth point-proto :data-seq ()
- (list (send self :x) (send self :y)))
- (defmeth point-proto :make-data (seq)
- (send point-proto :new (select seq 0) (select seq 1)))
- (defmeth point-proto :print (&optional (stream t))
- (format stream
- "#<a point located at x = ~d and y = ~d>"
- (send self :x)
- (send self :y)))
-