|
From: | Michael Erdmann |
Subject: | Re: [Chicken-users] Expecption Handling with chicken |
Date: | Fri, 01 Oct 2004 17:12:07 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616 |
Felix Winkelmann wrote:
Michael Erdmann wrote:Dear all, i am a little bit confused. The documentation i got together with 1.66 says there is an execpteion handling available according to srfi-12. When i am calling (CURRENT-EXCEPTION-HANDLER) the function is not known.Did you call "(CURRENT-EXCEPTION-HANDLER)" or "(current-exception-handler)"?(Chicken is case sensitive)
Thanks works. The interface i a little bit funy but look very mutch like the try...catch construct of java. ;; creating an intecepting an exception (call-with-current-continuation (lambda (exit) (handle-exceptions exn (begin (put-line "Went wrong") (exit exn) ) (put-line "Expression 1") (abort 'x))) ) Java: try { Expression1 throw .. } catch(Exception e) { } I can even use vectors or records to build exception types. Fine! Only this call-with-current-continuation is clumsy. Michael
cheers, felix
[Prev in Thread] | Current Thread | [Next in Thread] |