1 ;;;; To test the IGNORE/IGNORABLE behavior in CLOS, run COMPILE-FILE on
2 ;;;; this file and look at the output (warnings, etc.).
4 ;;;; (In sbcl-0.6.8.25, the handling of IGNORE and IGNORABLE in
5 ;;;; DEFMETHOD forms was rewritten to systematize the old PCL behavior.
6 ;;;; Now all required variables are IGNORABLE by default.)
8 ;;;; This software is part of the SBCL system. See the README file for
11 ;;;; While most of SBCL is derived from the CMU CL system, the test
12 ;;;; files (like this one) were written from scratch after the fork
15 ;;;; This software is in the public domain and is provided with
16 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
17 ;;;; more information.
21 (defgeneric foo (x y &key &allow-other-keys))
23 ;;; should have no STYLE-WARNINGs (e.g. about unused vars)
24 (defmethod foo ((x t) (y t))
27 ;;; should have no STYLE-WARNINGs
28 (defmethod foo ((x t) (y t) &key &allow-other-keys)
31 ;;; should have no STYLE-WARNINGs
32 (defmethod foo ((x t) (y t) &key &allow-other-keys)
33 (declare (ignorable x y))
36 ;;; should have no STYLE-WARNINGs
37 (defmethod foo ((x t) (y t) &key &allow-other-keys)
40 ;;; should have a STYLE-WARNING: using an IGNOREd variable
41 (defmethod foo ((x t) (y t) &key &allow-other-keys)
42 (declare (ignore x y))
45 ;;; should have no STYLE-WARNINGs
46 (defmethod foo (x y &key &allow-other-keys)
47 (declare (ignore x y))
50 ;;; should have no STYLE-WARNINGs
51 (defmethod foo ((x integer) (y t) &key &allow-other-keys)
52 (declare (ignore x y))
55 ;;; should have no STYLE-WARNINGs
56 (defmethod foo ((x integer) (y t) &key &allow-other-keys)
60 ;;; should have a STYLE-WARNING: Z is unused.
61 (defmethod foo ((x t) (y integer) &key z)