0.7.8.44:
authorWilliam Harold Newman <william.newman@airmail.net>
Thu, 17 Oct 2002 19:56:02 +0000 (19:56 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Thu, 17 Oct 2002 19:56:02 +0000 (19:56 +0000)
new reports and restart names trying to clarify what those
redefine-DEFSTRUCT CERROR restarts mean (cribbing
somewhat from CMU CL CVS)
While I'm at it, fix the behavior of the ABORT restart in
%REDEFINE-DEFSTRUCT, so that it leaves the system
unaffected as one might reasonably expect. (Before,
ABORTing then retrying an incompatible definition a
second time would allow the incompatible definition to
take place the second time with no error.)
As long as I'm proof-reading restart reports, use similar
FORMAT ~< tricks in some other restarts too.

TODO
src/code/debug.lisp
src/code/defstruct.lisp
src/code/save.lisp
src/code/toplevel.lisp
version.lisp-expr

diff --git a/TODO b/TODO
index f4ff1fe..fc2a12d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -29,8 +29,6 @@ for early 0.7.x:
                are now implemented as closures (because
                they're structure slot accessors) won't be so
                nasty in the debugger
-* rewrote long-standing confusing error restarts for redefining
-       DEFSTRUCTs
 * outstanding embarrassments
        ** cut-and-pasted DEF-BOOLEAN-ATTRIBUTE (maybe easier to fix
                now that EVAL-WHEN works correctly..)
index c582585..67c791f 100644 (file)
@@ -78,9 +78,9 @@
          *debug-command-level*))
   
 (defparameter *debug-help-string*
-"The prompt is square brackets, with number(s) indicating the current control
-  stack level and, if you've entered the debugger recursively, how deeply
-  recursed you are.
+"The debug prompt is square brackets, with number(s) indicating the current
+  control stack level and, if you've entered the debugger recursively, how
+  deeply recursed you are.
 Any command -- including the name of a restart -- may be uniquely abbreviated.
 The debugger rebinds various special variables for controlling i/o, sometimes
   to defaults (much like WITH-STANDARD-IO-SYNTAX does) and sometimes to 
@@ -94,8 +94,8 @@ Getting in and out of the debugger:
   RESTART  invokes restart numbered as shown (prompt if not given).
   ERROR    prints the error condition and restart cases.
   The number of any restart, or its name, or a unique abbreviation for its
-    name, is a valid command, and is the same as using RESTART to invoke that
-    restart.
+    name, is a valid command, and is the same as using RESTART to invoke
+    that restart.
 
 Changing frames:
   U      up frame     D    down frame
@@ -855,7 +855,7 @@ reset to ~S."
            (let ((level *debug-command-level*)
                  (restart-commands (make-restart-commands)))
              (with-simple-restart (abort
-                                  "Reduce debugger level (to debug level ~W)."
+                                  "~@<Reduce debugger level (to debug level ~W).~@:>"
                                    level)
                (debug-prompt *debug-io*)
                (force-output *debug-io*)
@@ -1239,9 +1239,8 @@ reset to ~S."
 ;;;  (throw 'sb!impl::toplevel-catcher nil))
 
 ;;; CMU CL supported this GO debug command, but SBCL doesn't -- in
-;;; SBCL you just type the CONTINUE restart name instead (or "RESTART
-;;; CONTINUE", that's OK too).
-
+;;; SBCL you just type the CONTINUE restart name instead (or "C" or
+;;; "RESTART CONTINUE", that's OK too).
 ;;;(!def-debug-command "GO" ()
 ;;;  (continue *debug-condition*)
 ;;;  (error "There is no restart named CONTINUE."))
index a894f47..96c8caa 100644 (file)
        (if (dd-class-p dd)
           (let ((inherits (inherits-for-structure dd)))
             `(progn
+               ;; Note we intentionally call %DEFSTRUCT first, and
+               ;; especially before %COMPILER-DEFSTRUCT. %DEFSTRUCT
+               ;; has the tests (and resulting CERROR) for collisions
+               ;; with LAYOUTs which already exist in the runtime. If
+               ;; there are any collisions, we want the user's
+               ;; response to CERROR to control what happens.
+               ;; Especially, if the user responds to the collision
+               ;; with ABORT, we don't want %COMPILER-DEFSTRUCT to
+               ;; modify the definition of the class.
+               (%defstruct ',dd ',inherits)
                (eval-when (:compile-toplevel :load-toplevel :execute)
                  (%compiler-defstruct ',dd ',inherits))
-               (%defstruct ',dd ',inherits)
                ,@(unless expanding-into-code-for-xc-host-p
                    (append ;; FIXME: We've inherited from CMU CL nonparallel
                            ;; code for creating copiers for typed and untyped
                            ;; structures. This should be fixed.
-                                       ;(copier-definition dd)
+                           ;(copier-definition dd)
                            (constructor-definitions dd)
                            (class-method-definitions dd)))
                ',name))
   (declare (type sb!xc:class class) (type layout old-layout new-layout))
   (let ((name (class-proper-name class)))
     (restart-case
-       (error "redefining class ~S incompatibly with the current definition"
+       (error "~@<attempt to redefine the ~S class ~S incompatibly with the current definition~:@>"
+              'structure-object
               name)
       (continue ()
-       :report "Invalidate current definition."
-       (warn "Previously loaded ~S accessors will no longer work." name)
-       (register-layout new-layout))
+       :report (lambda (s)
+                (format s
+                        "~@<Use the new definition of ~S, invalidating ~
+                          already-loaded code and instances.~@:>"
+                        name))
+       (register-layout new-layout))
+      (recklessly-continue ()
+       :report (lambda (s)
+                (format s
+                        "~@<Use the new definition of ~S as if it were ~
+                          compatible, allowing old accessors to use new ~
+                          instances and allowing new accessors to use old ~
+                          instances.~@:>"
+                        name))
+       ;; classic CMU CL warning: "Any old ~S instances will be in a bad way. 
+       ;; I hope you know what you're doing..."
+       (register-layout new-layout
+                       :invalidate nil
+                       :destruct-layout old-layout))
       (clobber-it ()
-       :report "Smash current layout, preserving old code."
-       (warn "Any old ~S instances will be in a bad way.~@
-              I hope you know what you're doing..."
-             name)
-       (register-layout new-layout :invalidate nil
-                        :destruct-layout old-layout))))
+       ;; FIXME: deprecated 2002-10-16, and since it's only interactive
+       ;; hackery instead of a supported feature, can probably be deleted
+       ;; in early 2003
+       :report "(deprecated synonym for RECKLESSLY-CONTINUE)"
+       (register-layout new-layout
+                       :invalidate nil
+                       :destruct-layout old-layout))))
   (values))
 
 ;;; This is called when we are about to define a structure class. It
index 2356255..1c0c79e 100644 (file)
        allocated objects into static space so that they stay pure. This takes
        somewhat longer than the normal GC which is otherwise done, but it's
        only done once, and subsequent GC's will be done less often and will
-       take less time in the resulting core file. See PURIFY.
+       take less time in the resulting core file. See the PURIFY function.
     :ROOT-STRUCTURES
        This should be a list of the main entry points in any newly loaded
        systems. This need not be supplied, but locality and/or GC performance
-       may be better if they are. Meaningless if :PURIFY is NIL. See PURIFY.
+       may be better if they are. Meaningless if :PURIFY is NIL. See the
+       PURIFY function.
     :ENVIRONMENT-NAME
-       This is also passed to PURIFY when :PURIFY is T. (rarely used)
+       This is also passed to the PURIFY function when :PURIFY is T.
+       (rarely used)
 
   The save/load process changes the values of some global variables:
     *STANDARD-OUTPUT*, *DEBUG-IO*, etc.
index 9f1a916..9cc5f67 100644 (file)
        ;; get you out to here.
        (with-simple-restart
           (abort
-           "Reduce debugger level (leaving debugger, returning to toplevel).")
+           "~@<Reduce debugger level (leaving debugger, returning to toplevel).~@:>")
         (catch 'toplevel-catcher
           #!-sunos (sb!unix:unix-sigsetmask 0) ; FIXME: What is this for?
           ;; in the event of a control-stack-exhausted-error, we should
index ce592d3..236eb25 100644 (file)
@@ -18,4 +18,4 @@
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.8.43"
+"0.7.8.44"