REPL exception handler should return for non-&serious conditions

Bug #242900 reported by Derick Eddington
2
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Committed
Medium
Abdulaziz Ghuloum

Bug Description

... to be congruent with R6RS requiring the default exception handler to return for non-&serious.

When porting R5RS code that semi-often reports warnings, I found reason to raise-continuable R6RS's &warning instead of just printing a warning message. When I use the library under Ikarus's REPL, these &warning exceptions cause the REPL to reset, but the code should continue running.

I've tried this out:

=== modified file 'scheme/ikarus.cafe.ss'
--- scheme/ikarus.cafe.ss 2008-05-01 10:02:36 +0000
+++ scheme/ikarus.cafe.ss 2008-06-25 11:38:15 +0000
@@ -69,11 +69,12 @@
         (lambda (k)
           (with-exception-handler
             (lambda (con)
- (reset-input-port! (console-input-port))
               (flush-output-port (console-output-port))
               (display "Unhandled exception\n" (console-error-port))
               (print-condition con (console-error-port))
- (k (void)))
+ (when (serious-condition? con)
+ (reset-input-port! (console-input-port))
+ (k (void))))
             (lambda ()
               (display-prompt 0)
               (let ([x (my-read k)])

Related branches

Changed in ikarus:
importance: Undecided → Medium
Revision history for this message
Derick Eddington (derick-eddington) wrote :

Bump :) This is preventing me from fully working with my SXML port in the REPL.

Revision history for this message
leppie (leppie) wrote :

+ (when (serious-condition? con)

should rather be:

(when (exists serious-condition? (simple-conditions con))

given you could have (condition (make-warning) (make-message-condition "eek!"))

Cheers

leppie

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 242900] Re: REPL exception handler should return for non-&serious conditions

On Jul 3, 2008, at 9:08 AM, leppie wrote:

> + (when (serious-condition? con)
>
> should rather be:
>
> (when (exists serious-condition? (simple-conditions con))

condition predicates do check for subconditions of a compound condition.

Revision history for this message
leppie (leppie) wrote :

Indeed! :-)

Changed in ikarus:
assignee: nobody → aghuloum
status: New → Confirmed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Fixed in 1530. Note that the way I fixed it is by installing two exception handlers: the outer one resets the repl, and the inner one prints the condition and returns. With your patch, doing (raise (make-warning)) from the repl causes ikarus to exit instead of returning to the repl.

Changed in ikarus:
status: Confirmed → Fix Committed
Revision history for this message
Derick Eddington (derick-eddington) wrote : Re: [Bug 242900] Re: REPL exception handler should return for non-&serious conditions

On Mon, 2008-07-07 at 07:55 +0000, Abdulaziz Ghuloum wrote:
> Fixed in 1530. Note that the way I fixed it is by installing two
> exception handlers: the outer one resets the repl, and the inner one
> prints the condition and returns.

Thanks!

> With your patch, doing (raise (make-
> warning)) from the repl causes ikarus to exit instead of returning to
> the repl.

Yeah, I noticed later... :)

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 242900] Re: REPL exception handler should return for non-&serious conditions

On Jul 7, 2008, at 2:25 AM, Derick Eddington wrote:

> Yeah, I noticed later... :)

Hmmm!!! And you didn't patch your patch!

Revision history for this message
Derick Eddington (derick-eddington) wrote : Re: [Bug 242900] Re: REPL exception handler should return for non-&serious conditions

On Mon, 2008-07-07 at 12:23 -0700, Abdulaziz Ghuloum wrote:
> On Jul 7, 2008, at 2:25 AM, Derick Eddington wrote:
>
> > Yeah, I noticed later... :)
>
> Hmmm!!! And you didn't patch your patch!

:) I wasn't sure what the best solution was for this issue.

Changed in ikarus:
milestone: none → 0.0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.