From 49095724dfe553133b0e85e68497245b02536619 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Wed, 19 Dec 2007 16:10:11 +0000 Subject: [PATCH] 1.0.12.38: style-warning IMPLICIT-GENERIC-FUNCTION-WARNING * Specific condition to signal when a generic function is implicitly signalled instead of a SIMPLE-STYLE-WARNING. --- NEWS | 3 +++ package-data-list.lisp-expr | 11 +++++------ src/code/condition.lisp | 7 +++++++ src/pcl/methods.lisp | 3 +-- version.lisp-expr | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index b8f07dc97..4d3a9180c 100644 --- 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) diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 8d96109de..dcb9dfcd0 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -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" diff --git a/src/code/condition.lisp b/src/code/condition.lisp index f9184fbd1..d2762ec0b 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -968,6 +968,13 @@ (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 "~@" + (implicit-generic-function-name condition))))) + (define-condition extension-failure (reference-condition simple-error) ()) diff --git a/src/pcl/methods.lisp b/src/pcl/methods.lisp index f8f13a7b7..657e665cf 100644 --- a/src/pcl/methods.lisp +++ b/src/pcl/methods.lisp @@ -220,8 +220,7 @@ 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 diff --git a/version.lisp-expr b/version.lisp-expr index b5bb7134e..9099b73ff 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 2.11.4.GIT