[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] exception handling



A typo in draft-3:
  (merror message obj ...)
   Message should be a string.  raise on a new created ...

The sentence starting with "raise" is missing a verb.  Perhaps "Invokes"?

The example listed after error does not make use of error.

More fundamentally, the paradigm seems very awkward.  The classic
exception-handling idiom in a language with non-continuable exception
seems to require call-cc, which is rather painful:

(call-cc
   (lambda (done)
     (with-exception-handler
        (lambda (ex)
          (handle-exception ex)
          (done #f))
       (lambda ()
          (stuff)))))

That's a lot of boiler-plate.
At least there should be some convenience syntax to make this less painful.
Kawa has try-patch:
   http://www.gnu.org/software/kawa/Exceptions.html#id2700609
This is somewhat Java-centric, but perhaps something like a cond-body 
for the
handler would work. For example:

   (try-catch                                    [Syntax]
       expression
       var ;; Bound to raised object
       (test body ...) ...)
-- 
	--Per Bothner
per@x   http://per.bothner.com/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports