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,FREEMAIL_FROM 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!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Ada exception block does NOT work? Date: Thu, 18 Aug 2005 15:15:14 +0200 Message-ID: <430489E2.2070601@mailinator.com> References: <4301ab29$0$6989$9b4e6d93@newsread2.arcor-online.net> <54s1ed.kjh.ln@hunter.axlog.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net MkCWUtFqs8NOWy5L3+l0PgjKUNig1TQXXQqphntdj+l1VfJJY= User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en In-Reply-To: <54s1ed.kjh.ln@hunter.axlog.fr> Xref: g2news1.google.com comp.lang.ada:4162 Date: 2005-08-18T15:15:14+02:00 List-Id: 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. I suppose this can happen in any language which allows propagation of arbitrary objects, though I don't have experience in this scenary and its side effects. In Ada, one can argue that being the exception a special feature with known and limited form, can't have this kind of failure (which is important since exceptions are raised mostly when error conditions arise). I see in the RM that there's a permission for an implementation to truncate the message associated with any exception, could be this the reason? I suppose this can be mitigated if some "raw" exception is always propagable when everything else fails. In that case, failing to allocate the proper exception could raise this "raw" other, and we would be in equal terms (almost) with Ada. Well, I'm speculating but would be definitely interested in hearing more from someone more informed. -- Take the Snape polls: http://snape.mosteo.com [Updated 16/05]