Methods
? (defclass shy-kid (fourth-grader)())
#<STANDARD-CLASS SHY-KID>
? (defmethod say ((child shy-kid) sentence)
(princ "...")
(princ sentence)
(princ "...")
(terpri))
#<Method SAY (SHY-KID T)>
? (setq max (make-instance 'shy-kid))
#<SHY-KID #x609A69>
? (say max "Hi")
...Hi...
NILAn instance of a subclass still inherits slot values and methods from its class's superclasses.
? (school max)
"Lawrence School"
Generated with Harlequin WebMaker