Subject: [clisp-list] Change Request on INVOKE-RESTART-INTERACTIVELY

From: Ken Dickey <[email-masked]>
Date: Sun Sep 30 18:23:01 2001

Greetings,

I was looking at the sample code in the CL-HyperSpec on restarts and noticed 
that CLisp had a different behaviour.  In particular the restart-report was 
not printed when the restart was invoked interactively.  I got the expected 
behaviour when I redefined INVOKE-RESTART-INTERACTIVELY in the 
"condition.lisp" source file to output the report.

;; INVOKE-RESTART-INTERACTIVELY, CLtL2 p. 911
(defun invoke-restart-interactively (restart-identifier)
  (let ((restart (find-restart restart-identifier)))
    (unless restart (restart-not-found restart-identifier))
    ;; repeat the :report if available
    (let ((report (restart-report restart)))
      (when report
	(format t "~a~%" report)
	(finish-output)))
    (let ((arguments (funcall (restart-interactive restart))))
      (%invoke-restart restart arguments)
) ) )

By the way, thanks much for CLisp!!!  I have just started using it and really 
appreciate it.

Cheers,
-KenD

---

From: Sam Steingold <[email-masked]>
Date: Sun Sep 30 21:16:01 2001

> * In message <01093018211300.00264@bandicoot>
> * On the subject of "[clisp-list] Change Request on INVOKE-RESTART-INTERACTIVELY"
> * Sent on Sun, 30 Sep 2001 18:21:13 -0700
> * Honorable Ken Dickey <[email-masked]> writes:
>
> I was looking at the sample code in the CL-HyperSpec on restarts and
> noticed that CLisp had a different behaviour.

the example is bogus:
READ-NEW-VALUE should ask "enter new value" while the example reads
"Enter a new ice cream:"

> In particular the restart-report was not printed when the restart was
> invoked interactively.  I got the expected behaviour when I redefined
> INVOKE-RESTART-INTERACTIVELY in the "condition.lisp" source file to
> output the report.
> 

you mean (funcall report *terminal-io*), right?

> 	(finish-output)))

I don't think you need this.

>       (%invoke-restart restart arguments)

I don't think that there is much use printing the restart description
yet again:

we have now:

*** - Bad tasting sundae with VANILLA, CARAMEL, and CHERRY
The following restarts are available:
R1 = Use a new ice cream.
R2 = Use a new sauce.
R3 = Use a new topping.

1. Break [2]> r1
Enter a new value: 'c

you want:

*** - Bad tasting sundae with VANILLA, CARAMEL, and CHERRY
The following restarts are available:
R1 = Use a new ice cream.
R2 = Use a new sauce.
R3 = Use a new topping.

1. Break [2]> r1
Use a new ice cream.
Enter a new value: 'c

I doubt this is much better.

> By the way, thanks much for CLisp!!!  I have just started using it and
> really appreciate it.

you are very welcome!

-- 
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel>
Read what the Arab leaders say to their people on <http://www.memri.org/>
(let ((a "(let ((a %c%s%c)) (format a 34 a 34))")) (format a 34 a 34))