diff --git a/scsh/interaction/AUTHORS b/scsh/interaction/AUTHORS index c8931a5..6f9a0fc 100644 --- a/scsh/interaction/AUTHORS +++ b/scsh/interaction/AUTHORS @@ -1 +1 @@ -Copyright (c) 2003 Martin Gasbichler +Copyright (c) 2003,2005 Martin Gasbichler diff --git a/scsh/interaction/NEWS b/scsh/interaction/NEWS index 9531b4b..1389c4a 100644 --- a/scsh/interaction/NEWS +++ b/scsh/interaction/NEWS @@ -1,3 +1,12 @@ +version 0.3 +* Handler of WITH-FATAL-AND-CAPTURING-ERROR-HANDLER also receives the + continuation of the handler as a procedure +* Continuation and its dynamic environment is re-installed after exit of remote + REPL + +version 0.2 +* ??? + version 0.1 * New package system. * New structure GC in interaction diff --git a/scsh/interaction/README b/scsh/interaction/README index 2fb2f7c..1a55851 100644 --- a/scsh/interaction/README +++ b/scsh/interaction/README @@ -116,19 +116,19 @@ WARNING: Returning does not work from a scsh with a running REPL!!! An exception handler with allows to capture the continuation of the exception. Here HANDLER is a procedure like -(handler condition continuation decline) -> val +(handler condition raw-continuation condition decline) -> val CONDITION and DECLINE are the same as in the usual WITH-HANDLER -procedure. CONTINUATION represents the continuation of the -exception. However, this is not a procedure but the VM's continuation -object. The continuation of HANDLER is the continuation of -WITH-FATAL-AND-CAPTURING-ERROR-HANDLER. +procedure. RAW-CONTINUATION and CONTIUNATION represent the +continuation of the exception. RAW-CONTINUATION is not a procedure but +the VM's continuation object. The continuation of HANDLER is the +continuation of WITH-FATAL-AND-CAPTURING-ERROR-HANDLER. -(display-continuation continuation [port] -> unspecified +(display-continuation raw-continuation [port] -> unspecified The procedural analogy to the ,proceed command. Continuation must be a -continuation object as captured by +raw continuation object as captured by WITH-FATAL-AND-CAPTURING-ERROR-HANDLER, not a procedure as captured by CALL-WITH-CURRENT-CONTINUATION. diff --git a/scsh/interaction/inspect-exception.scm b/scsh/interaction/inspect-exception.scm index b57f947..979f3ba 100644 --- a/scsh/interaction/inspect-exception.scm +++ b/scsh/interaction/inspect-exception.scm @@ -10,31 +10,34 @@ (lambda (accept) ((call-with-current-continuation (lambda (k) - (with-handler - (lambda (condition more) - (primitive-cwcc - (lambda (condition-continuation) - (if (error? condition) - (call-with-current-continuation - (lambda (decline) - (k (lambda () - (handler condition condition-continuation decline)))))) - (more)))) ; Keep looking for a handler. - (lambda () (call-with-values thunk accept))))))))) + (with-handler + (lambda (condition more) + (primitive-cwcc + (lambda (raw-condition-continuation) + (call-with-current-continuation + (lambda (condition-continuation) + (call-with-current-continuation + (lambda (decline) + (k (lambda () + (handler condition raw-condition-continuation + condition-continuation decline))))) + (more)))))) ; Keep looking for a handler. + (lambda () (call-with-values thunk accept))))))))) (define (with-inspecting-handler port prepare thunk) (with-fatal-and-capturing-error-handler - (lambda (condition condition-continuation more) + (lambda (condition raw-condition-continuation condition-continuation more) (with-handler - (lambda (c2 m2) + (lambda (condition-continuation ignore) (more)) (if (prepare condition) (let ((res (remote-repl "Welcome to the command processor of the remote scsh" - condition-continuation + raw-condition-continuation port))) - ;; TODO: option to return to continuation of handler (by leaving out the with-continuation) - (with-continuation condition-continuation (lambda () res))) + ;; TODO: option to return to continuation of handler + ;; (by leaving out this call) + (condition-continuation res)) (more)))) thunk)) diff --git a/scsh/interaction/pkg-def.scm b/scsh/interaction/pkg-def.scm index 1b8ee5f..079e020 100644 --- a/scsh/interaction/pkg-def.scm +++ b/scsh/interaction/pkg-def.scm @@ -1,5 +1,5 @@ (define-package "interaction" - (0 2) + (0 3) ((install-lib-version (1 0))) (write-to-load-script `((config)