5 ;;;; It should be possible to do DEFGENERIC and DEFMETHOD referring to
6 ;;;; structure types defined earlier in the file.
8 (defstruct struct-a x y)
9 (defstruct struct-b x y z)
11 (defmethod wiggle ((a struct-a))
14 (defgeneric jiggle ((arg t)))
15 (defmethod jiggle ((a struct-a))
18 (defmethod jiggle ((b struct-b))
23 (assert (= (wiggle (make-struct-a :x 6 :y 5))
24 (jiggle (make-struct-b :x 19 :y 6 :z 2))))
26 ;;; Compiling DEFGENERIC should prevent "undefined function" style warnings
27 ;;; from code within the same file.
29 (defgeneric gf-defined-in-this-file ((x number) (y number)))
30 (defun function-using-gf-defined-in-this-file (x y n)
32 (gf-defined-in-this-file x y)))