Path: news.daimi.aau.dk!news.uni-c.dk!newsfeed.sunet.se!news00.sunet.se!sunic!nntp.coast.net!howland.reston.ans.net!ix.netcom.com!news From: David Brownell Newsgroups: comp.object,comp.lang.eiffel,comp.lang.c++,comp.lang.beta,comp.lang.java,comp.lang.sather Subject: Re: What Should An Exception Handling Do? -- Clarification of rules Date: Tue, 26 Mar 1996 16:20:33 -0800 Organization: Dave's VAX Lines: 22 Message-ID: <315889D1.3316@ix.netcom.com> References: <1996Mar14.155641.4299@schbbs.mot.com> <4irn11$7ln@mimas.brunel.ac.uk> NNTP-Posting-Host: pax-ca23-07.ix.netcom.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-NETCOM-Date: Tue Mar 26 6:28:21 PM CST 1996 X-Mailer: Mozilla 2.0 (Win95; I) CC: brownell@ix.netcom.com Xref: news.daimi.aau.dk comp.object:53267 comp.lang.eiffel:22527 comp.lang.c++:175243 comp.lang.beta:10683 comp.lang.java:28924 comp.lang.sather:12362 In the context of that "C++ done me wrong" flamage, someone had a good point that it's useful to be able to reclaim resources and automagically retry. However, the "resumable exceptions" model seems to be less useful than a model that's already possible in C++ and most languages: call in those overdue books, taxes, etc. since you know who has them! Or even the model that's used in the C++ runtime: set_new_handler() is a hook that lets applications free up memory when needed. The same can be done on a per-class basis whenever needed. I missed the original posting ... but assuming the title is a good summary, I think C++ "catch" clauses should only be responsible for fault recovery or reporting. The "clean up" aspects should be mapped to classes, like "smart pointers", that release memory and other resources as appropriate when they're destroyed as part of the stack unwinding that the exception initiated. -- David Brownell Enjoy the blossoms of Enlightenment in their season and harvest the fruit of the right path.