(uiop:define-package :solar-short/class (:export #:book #:display-haiku) (:import-from :asdf)) (in-package :solar-short/class) (defclass book () ((haikus :initform (list "haiku 1" "haiku 2" "haiku 3")) (current :initform 0))) (defmethod display-haiku ((obj book) stream) (with-slots (haikus current) obj (princ (nth current haikus) stream))) ;; (defmethod next-haiku ((book book)) ;; (setf (current book) ;; (+ (if (= (current book) (length (haikus book))) ;; 0 ;; 1) ;; (current book))))