[Bug-openmcl] WITH-SIMPLE-RESTART

bryan o'connor bryan-openmcl at lunch.org
Wed Feb 25 16:52:41 MST 2004


> (I'm not sure whether the bug's in WITH-SIMPLE-RESTART or elsewhere.
> 0.13.7 works; there were a few condition-system changes between
> 0.14-031220 and 0.14.1, so this may have been introduced then.)

i had patched with-simple-restart to create a restart with its
function set to #'(lambda () (values nil T)).

i did this so invoke-restart would return the ansi-spec'd value
(nil T) for with-simple-restart but nil otherwise.

but.. invoke-restart expects that function to actually do something
besides return a value.. so clearly i was both clever and wrong.

what do you think of this as a fix --

   1) change the cond in invoke-restart based on fn
	   if nil       - restart, return nil
	   if fixnump   - restart, return (cons fn values)
	   if functionp - apply fn values
	   else         - assume simple-restart, return (values nil T).

   2) in with-simple-restart, set the function to 'simple-restart.
      (or anything that is non-nil, not fixnump, not functionp.)

                         ...bryan


-------------- next part --------------
Index: level-1/l1-error-system.lisp
===================================================================
RCS file: /usr/local/tmpcvs/ccl-0.14-dev/ccl/level-1/l1-error-system.lisp,v
retrieving revision 1.7
diff -u -r1.7 l1-error-system.lisp
--- level-1/l1-error-system.lisp	2 Feb 2004 16:15:53 -0000	1.7
+++ level-1/l1-error-system.lisp	25 Feb 2004 23:49:03 -0000
@@ -497,7 +497,10 @@
              (throw tag nil))
             ((fixnump fn)               ; restart case
              (throw tag (cons fn values)))
-            (t (apply fn values))))))   ; restart bind
+            ((functionp fn)             ; restart bind
+             (apply fn values))
+            (t                          ; with-simple-restart
+             (throw tag (values nil T)))))))
 
 (defun invoke-restart-no-return (restart)
   (invoke-restart restart)
Index: lib/macros.lisp
===================================================================
RCS file: /usr/local/tmpcvs/ccl-0.14-dev/ccl/lib/macros.lisp,v
retrieving revision 1.14
diff -u -r1.14 macros.lisp
--- lib/macros.lisp	15 Feb 2004 16:16:15 -0000	1.14
+++ lib/macros.lisp	25 Feb 2004 23:49:07 -0000
@@ -423,7 +423,7 @@
     (let ((stream (gensym)))
       (setq format-string `#'(lambda (,stream) (format ,stream ,format-string , at format-args)))))
   `(let* ((,temp (%cons-restart ',restart-name
-                                #'(lambda () (values nil t))
+                                'simple-restart
                                 ,format-string
                                 nil
                                 nil))
-------------- next part --------------



More information about the Bug-openmcl mailing list