From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ee1a8b8db84c88f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!newsfeed.gamma.ru!Gamma.RU!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada exception block does NOT work? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4301ab29$0$6989$9b4e6d93@newsread2.arcor-online.net> <54s1ed.kjh.ln@hunter.axlog.fr> <430489E2.2070601@mailinator.com> Date: Thu, 18 Aug 2005 17:23:47 +0200 Message-ID: NNTP-Posting-Date: 18 Aug 2005 17:23:47 MEST NNTP-Posting-Host: 14e07082.newsread2.arcor-online.net X-Trace: DXC=MZa[NE8[gdfXiD6\]5e5enQ5U85hF6f;djW\KbG]kaMh6=9@_^ On Thu, 18 Aug 2005 15:15:14 +0200, Alex R. Mosteo wrote: > Jean-Pierre Rosen wrote: >> Maciej Sobczak a �crit : > >>> Note that those other languages can throw regular objects as >>> exceptions, thus enabling polymorphism when they are handled. One >>> could say that *this* is the point of good integration and that Ada's >>> exceptions are a conceptual patch that did not integrate with the rest >>> of the object model, leading to two separate spaces of language >>> entities instead of only one. >> >> This boils down to the (controversial) question of how much information >> should be associated to an exception. It could be the programmer's >> responsibility to store the context when an exception is raised, rather >> than propagating it with the exception. In Ada83, an exception had just >> an identity, and Jean Ichbiah (the father of Ada) claimed that he >> regretted having more than one exception. In Ada95, a string can be >> associated to an exception. In C++, any object can be thrown, while in >> Java only an object belonging to the throwable class. Note also that >> augmenting the quantity of information associated to an exception has a >> performance cost, which may be important for a real-time oriented >> language like Ada. So, you see the question is quite open... > > I think the crux in this last point: you don't want that, once an > exception is being raised, you fail to propagate it because it can't be > allocated due to exhausted memory, for example. Another problem is that the type of the exception object may leave its scope while exception propagation. It might not be the case in C++ which has it global, but it is in Ada. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de