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,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <1111607633.301232.62490@z14g2000cwz.googlegroups.com> Date: Thu, 24 Mar 2005 08:48:27 +0100 Message-ID: NNTP-Posting-Date: 24 Mar 2005 08:48:22 MET NNTP-Posting-Host: d3c44fde.newsread4.arcor-online.net X-Trace: DXC=lAFAjl2bYcWghFd\k@b23T:ejgIfPPldTjW\KbG]kaMXea\9g\;7NmUo;AeMbPdSj^[6LHn;2LCV^COgUkn_?_Y_[NIWR>=fLjR X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:9894 comp.lang.c++:47016 comp.realtime:1674 comp.software-eng:5279 Date: 2005-03-24T08:48:22+01:00 List-Id: On 23 Mar 2005 17:01:56 -0500, Robert A Duff wrote: > Martin Dowie writes: > >> Jerry Coffin wrote: >>> And, once >>> again, the addition of tagged records to Ada 95 testifies to the fact >>> that even its own designers recognized the improvement this adds in >>> general, but (whether due to shortsightedness, concerns for backward >>> compatibility or whatever) didn't allow this improvement to be applied >>> in this situation. >> >> Almost certainly backwards compatibility - but I'm sure Bob and/or Randy >> could shed more light on that... > > Well, actually, during the Ada 9X design I tried to push for a > class-hierarchy of exceptions. I don't like every detail of the way C++ > does it, but at least in *this* regard, it's better than Ada. I think it is a question whether exception hierarchy has to be mapped on (1) types, (2) subtypes or (3) value ranges. C++ sticks to (1) which is problematic without ad-hoc supertypes. Presently it ends up with a mess in the list of catch'es. I think that (3) may have a chance. > Jerry Coffin is wrong that Ada does not allow attaching information to > exception, by the way. Ada allows attaching Strings, which is > admittedly a kludge. Using the class-hierarchy, as Jerry advocates, > would be cleaner, and type safe. The problems with that: 1. An exception object referring to a scope that does not exist (mounting accessibility rules?) 2. The target of an dispatching method is out of scope. 3. The whole scope of the exception type is finalized before "catch". 4. How to check that choices don't intersect? (C++ dependency of the order of catch is error-prone.) 5. The hierarchy of types may not reflect the hierarchy needed by an exception handler. How to do enumeration and ranges of exception objects having different types? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de