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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news3.google.com!news.glorb.com!news.agarik.com!194.2.0.24.MISMATCH!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Ada exception block does NOT work? Date: Thu, 18 Aug 2005 13:40:55 +0200 Organization: Adalog Message-ID: <54s1ed.kjh.ln@hunter.axlog.fr> References: <4301ab29$0$6989$9b4e6d93@newsread2.arcor-online.net> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1124366474 6253 195.25.228.57 (18 Aug 2005 12:01:14 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 18 Aug 2005 12:01:14 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: fr, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:4160 Date: 2005-08-18T13:40:55+02:00 List-Id: Maciej Sobczak a �crit : > Jeffrey R. Carter wrote: > >> Ada has had exceptions, well integrated with the rest of the language, >> since Ada 80. Ada's terminology is that exceptions are raised and >> handled. > > > OK, but the question is not about terminology, really. > > If you claim that exceptions were "patched" on to the C++ language that > did not have them originally, then let's switch the context to other > language that has no history issue like this. There are no predefined exceptions in C++, therefore things like arithmetic overflow have undefined semantics, rather than raising an exception [...] > Why do you claim that Ada's exceptions are "better integrated into the > language than in the languages that throw and catch them"? Every sequence of statements can have an exception handler in Ada, while in C++/Java/C# you must add an extra level of nesting. This gives the feeling that dealing with exceptions is something you just put in very special places, while in Ada you are more inclined to considering exceptions everywhere. > 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... -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr