From 5a13085f229ae776f68f56355e67879e484c02ed Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Tue, 20 Dec 2005 10:31:07 +0000 Subject: [PATCH] Adding a new specialization to a generic function does not result in a warning when the function is in a locked package --- src/CHANGELOG | 3 +++ src/clos/generic.lsp | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/CHANGELOG b/src/CHANGELOG index 7e87780aa..f2e62cd86 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -26,6 +26,9 @@ ECL 0.9i > (SETQ X 1) 1 + - Adding a new method to a generic function does no longer result in a warning + when the function belongs to a locked package. + ;;; Local Variables: *** ;;; mode:text *** ;;; fill-column:79 *** diff --git a/src/clos/generic.lsp b/src/clos/generic.lsp index 2512aa151..b894aea33 100644 --- a/src/clos/generic.lsp +++ b/src/clos/generic.lsp @@ -230,15 +230,16 @@ (setf gfun (fdefinition traced))) (cond ((not (legal-generic-function-name-p name)) (simple-program-error "~A is not a valid generic function name" name)) - ((not (fboundp name))) + ((not (fboundp name)) + (setf (fdefinition (or traced name)) + (apply #'ensure-generic-function-using-class gfun name args))) ;; a generic function already exists - ((si::instancep (or gfun (setf gfun (fdefinition name))))) + ((si::instancep (or gfun (setf gfun (fdefinition name)))) + gfun) ((special-operator-p name) (simple-program-error "The special operator ~A is not a valid name for a generic function" name)) ((macro-function name) (simple-program-error "The symbol ~A is bound to a macro and is not a valid name for a generic function" name)) (t (simple-program-error "The symbol ~A is bound to an ordinary function and is not a valid name for a generic function" name)) - ) - (setf (fdefinition (or traced name)) - (apply #'ensure-generic-function-using-class gfun name args)))) + )))