From beccf6c476f5cf2ef0bd839866527a46ec88d626 Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Sat, 19 Jun 2004 21:42:49 +0000 Subject: [PATCH] 0.8.11.19: DEFSTRUCT shouldn't issue warnings for FBOUNDP conflicts at macroexpansion time. (at compile time or load time, OK, but not macroexpansion time) Make DESCRIBE on a gf report its method combination. manual fix from Brian Mastenbrook sbcl-devel 16 Jun 2004 --- doc/manual/debugger.texinfo | 18 ++++++++++++++++-- src/code/defstruct.lisp | 21 ++++++++++++++------- src/pcl/describe.lisp | 4 +++- tests/defstruct.impure.lisp | 9 +++++++++ version.lisp-expr | 2 +- 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/doc/manual/debugger.texinfo b/doc/manual/debugger.texinfo index 82a8f27..493471c 100644 --- a/doc/manual/debugger.texinfo +++ b/doc/manual/debugger.texinfo @@ -55,7 +55,7 @@ or @item the debugger is explicitly entered with the Lisp @code{break} or -@code{debug} functions. +@code{invoke-debugger} functions. @end itemize @@ -78,6 +78,20 @@ execution after this error. In this case, both options return to top-level. After printing its banner, the debugger prints the current frame and the debugger prompt. +When the debugger is invoked by a condition, ANSI mandates that the +value of @code{*debugger-hook*}, if any, be called with two arguments: +the condition that caused the debugger to be invoked and the previous +value of @code{*debugger-hook*}. When this happens, +@code{*debugger-hook*} is bound to NIL to prevent recursive +errors. However, ANSI also mandates that @code{*debugger-hook*} not be +invoked when the debugger is to be entered by the @code{break} +function. For users who wish to provide an alternate debugger +interface (and thus catch @code{break} entries into the debugger), +SBCL provides @code{sb-ext:*invoke-debugger-hook*}, which is invoked +during any entry into the debugger. + +@include var-sb-ext-star-invoke-debugger-hook-star.texinfo + @node The Debugger Command Loop @comment node-name, next, previous, up @@ -125,7 +139,7 @@ current frame. For more information on debugger variable access, see In the debugger, it is possible to override the printing behaviour of the REPL. -@defvr {Variable} *debug-print-variable-alist* +@defvr {Variable} sb-debug:*debug-print-variable-alist* An association list describing new bindings for special variables (typically *PRINT-FOO* variables) to be used within the debugger, e.g. diff --git a/src/code/defstruct.lisp b/src/code/defstruct.lisp index 0660f8e..6d70ebe 100644 --- a/src/code/defstruct.lisp +++ b/src/code/defstruct.lisp @@ -657,11 +657,18 @@ remove the ambiguity in your code.~@:>" accessor-name) (setf (dd-predicate-name defstruct) nil)) - #-sb-xc-host - (when (and (fboundp accessor-name) - (not (accessor-inherited-data accessor-name defstruct))) - (style-warn "redefining ~S in DEFSTRUCT" accessor-name))) - + ;; FIXME: It would be good to check for name collisions here, but + ;; the easy check, + ;;x#-sb-xc-host + ;;x(when (and (fboundp accessor-name) + ;;x (not (accessor-inherited-data accessor-name defstruct))) + ;;x (style-warn "redefining ~S in DEFSTRUCT" accessor-name))) + ;; which was done until sbcl-0.8.11.18 or so, is wrong: it causes + ;; a warning at MACROEXPAND time, when instead the warning should + ;; occur not just because the code was constructed, but because it + ;; is actually compiled or loaded. + ) + (when default-p (setf (dsd-default slot) default)) (when type-p @@ -673,8 +680,8 @@ (if read-only (setf (dsd-read-only slot) t) (when (dsd-read-only slot) - (error "Slot ~S is :READ-ONLY in parent and must be :READ-ONLY in subtype ~S." - name + (error "~@" (dsd-name slot))))) slot)) diff --git a/src/pcl/describe.lisp b/src/pcl/describe.lisp index d459b53..4fd565a 100644 --- a/src/pcl/describe.lisp +++ b/src/pcl/describe.lisp @@ -92,9 +92,11 @@ (defmethod describe-object ((fun standard-generic-function) stream) (format stream "~&~A is a generic function." fun) (when (documentation fun t) - (format stream "~& Function documentation: ~A" (documentation fun t))) + (format stream "~&Its documentation is: ~A" (documentation fun t))) (format stream "~&Its lambda-list is:~& ~S" (generic-function-pretty-arglist fun)) + (format stream "~&Its method-combination is:~& ~S" + (generic-function-method-combination fun)) (let ((methods (generic-function-methods fun))) (if (null methods) (format stream "~&It has no methods.~%") diff --git a/tests/defstruct.impure.lisp b/tests/defstruct.impure.lisp index 8f2f5b2..a23302f 100644 --- a/tests/defstruct.impure.lisp +++ b/tests/defstruct.impure.lisp @@ -542,6 +542,15 @@ (assert (not (bug-332b-aux-p #(1 2 3 4 5 x 1 2 bug-332a-aux)))) (assert (bug-332b-aux-p #(1 2 3 4 5 x 1 2 bug-332b-aux))) +;;; In sbcl-0.8.11.8 FBOUNDPness potential collisions of structure +;;; slot accessors signalled a condition at macroexpansion time, not +;;; when the code was actually compiled or loaded. +(let ((defstruct-form '(defstruct bug-in-0-8-11-8 x))) + (defun bug-in-0-8-11-8-x (z) (print "some unrelated thing")) + (handler-case (macroexpand defstruct-form) + (warning (c) + (error "shouldn't warn just from macroexpansion here")))) + ;;; success (format t "~&/returning success~%") (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 5a77931..decfd2a 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".) -"0.8.11.18" +"0.8.11.19" -- 1.7.10.4