Example - Rectangles
Define a class using inheritance
(defclass rectangle (square)
((height :initform 0 :initarg :height
:accessor height)))
;; rectangle inherits from square
(setq my-rectangle
(make-instance 'rectangle :x 10 :y 30
:width 10 :height 12))
Previous slide
Next slide
Back to first slide
View graphic version