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-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newscon02.news.prodigy.com!prodigy.net!cyclone.swbell.net!bos-service1.raytheon.com!dfw-service2.ext.ray.com.POSTED!53ab2750!not-for-mail From: Jeffrey Carter User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada exception block does NOT work? References: <4301ab29$0$6989$9b4e6d93@newsread2.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <%s2Ne.2$5F1.1@dfw-service2.ext.ray.com> Date: Thu, 18 Aug 2005 09:13:47 -0700 NNTP-Posting-Host: 147.24.111.90 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.ray.com 1124381627 147.24.111.90 (Thu, 18 Aug 2005 11:13:47 CDT) NNTP-Posting-Date: Thu, 18 Aug 2005 11:13:47 CDT Organization: Raytheon Company Xref: g2news1.google.com comp.lang.ada:4166 Date: 2005-08-18T09:13:47-07:00 List-Id: Maciej Sobczak wrote: > > Why do you claim that Ada's exceptions are "better integrated into the > language than in the languages that throw and catch them"? The core of C++ was designed before exceptions were added to the language, so the main part of the language is not designed with exceptions in mind. Ada's design included exceptions from the beginning, and exceptions are part of the definition of the semantics of all parts of the language. That's the basis of the claim. This appears in different ways, which considered independently may not be sufficiently compelling as support for the claim. The try/catch block is one such symptom. That the C++ core language tends to have undefined/implementation-defined semantics where Ada has semantics defined in terms of exceptions is another. Other C descendants seem to have adopted C++'s exception handling syntax and semantics, with varying degrees of back fitting to the core language. > 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. The idea that disparate concepts should be implemented using a single mechanism is generally a poor one. Not everything should be viewed as a number; not everything should be viewed as an object; not everything should be implemented with inheritance and dispatching; not everything should be implemented with tasks and protected objects. On a more concrete level, Ada's was initially intended for critical, real-time, embedded SW. Allowing an arbitrary object to be used as/associated with an exception in such systems may not be a good idea. Additionally, Ada allows nested scopes, which C and its descendants do not. This allows the existence of anonymous exceptions, exceptions that have propagated out of the scope of their definitions. Allowing arbitrary objects as/associated with exceptions gives rise to a similar set of problems as allowing type extensions at a deeper scope than the parent. -- Jeffrey Carter "Now go away or I shall taunt you a second time." Monty Python and the Holy Grail E-mail: jeffrey_r_carter-nr [commercial-at] raytheon [period | full stop] com