Methods
initialize-instance. A method on initialize-instance for fourth-grader might look like the following:
(defmethod initialize-instance ((child fourth-grader)
&rest initargs)
(add-to-class-list child)
(check-vaccinations child)
(check-special-programs child))
When an instance of fourth-grader is created, make-instance calls initialize-instance, which calls the functions add-to-class-list and so on. These functions run their methods for fourth-grader. The functions that make-instance calls do not need to be generic functions and, if they are, do not need to have methods specifically for fourth-grader; they might have methods for one of the class's superclasses.
Generated with Harlequin WebMaker