(defclass polygon () ()) (defgeneric number-of-sides ((f polygon)) (:documentation "returns the number of sides of a polygon")) (defgeneric perimetre ((f polygon))) (defgeneric get-sides ((f polygon)) (:documentation "returns the list of sides of a polygon")) (defmethod perimetre ((f polygon)) (reduce #'+ (get-sides f)))