1.0.12.38: style-warning IMPLICIT-GENERIC-FUNCTION-WARNING
authorNikodemus Siivola <nikodemus@random-state.net>
Wed, 19 Dec 2007 16:10:11 +0000 (16:10 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 19 Dec 2007 16:10:11 +0000 (16:10 +0000)
 * Specific condition to signal when a generic function is implicitly
   signalled instead of a SIMPLE-STYLE-WARNING.

NEWS
package-data-list.lisp-expr
src/code/condition.lisp
src/pcl/methods.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index b8f07dc..4d3a918 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ changes in sbcl-1.0.13 relative to sbcl-1.0.12:
     unparsing of directory pathnames as files. Analogously,
     SB-EXT:PARSE-NATIVE-NAMESTRING takes an AS-DIRECTORY, forcing a
     filename to parse into a directory pathname.
+  * enhancement: implicit generic function creation now signals a
+    specific style-warning IMPLICIT-GENERIC-FUNCTION-WARNING, which
+    users can bind handlers for and muffle around calls to LOAD.
   * enhancement: RUN-PROGRAM allows unicode arguments and environments
     to be used (using the default stream external format), and allows
     non-simple strings to be used. (thanks to Harald Hanche-Olsen)
index 8d96109..dcb9dfc 100644 (file)
@@ -630,14 +630,13 @@ like *STACK-TOP-HINT* and unsupported stuff like *TRACED-FUN-LIST*."
                "DISABLE-PACKAGE-LOCKS"
                "ENABLE-PACKAGE-LOCKS"
 
-               ;; error signalled when attempt to load an invalid fasl
-               ;; is made, so that user code can try to recompile, etc.
+               ;; Custom conditions & condition accessors for users to handle.
+               "CODE-DELETION-NOTE"
+               "COMPILER-NOTE"
+               "IMPLICIT-GENERIC-FUNCTION-NAME"
+               "IMPLICIT-GENERIC-FUNCTION-WARNING"
                "INVALID-FASL"
 
-               ;; conditions that can be handled to reduce compiler
-               ;; verbosity
-               "CODE-DELETION-NOTE" "COMPILER-NOTE"
-
                ;; and a mechanism for controlling same at compile time
                "MUFFLE-CONDITIONS" "UNMUFFLE-CONDITIONS"
 
index f9184fb..d2762ec 100644 (file)
     (format-args-mismatch simple-style-warning)
   ())
 
+(define-condition implicit-generic-function-warning (style-warning)
+  ((name :initarg :name :reader implicit-generic-function-name))
+  (:report
+   (lambda (condition stream)
+     (format stream "~@<Implicitly creating new generic function ~S.~:@>"
+             (implicit-generic-function-name condition)))))
+
 (define-condition extension-failure (reference-condition simple-error)
   ())
 
index f8f13a7..657e665 100644 (file)
                               specializers lambda-list &rest other-initargs)
   (unless (and (fboundp generic-function-name)
                (typep (fdefinition generic-function-name) 'generic-function))
-    (style-warn "implicitly creating new generic function ~S"
-                generic-function-name))
+    (warn 'implicit-generic-function-warning :name generic-function-name))
   (let* ((existing-gf (find-generic-function generic-function-name nil))
          (generic-function
           (if existing-gf
index b5bb713..9099b73 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.12.37"
+"1.0.12.38"