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-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!cycny01.gnilink.net!cyclone1.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny08.POSTED!0f19ed38!not-for-mail From: "Frank J. Lhota" Reply-To: NOSPAM.lhota@adarose.com 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> <%s2Ne.2$5F1.1@dfw-service2.ext.ray.com> <1124383129.977718.320820@g44g2000cwa.googlegroups.com> <1124388461.739578.189030@g14g2000cwa.googlegroups.com> <1124390687.309704.156800@g44g2000cwa.googlegroups.com> In-Reply-To: <1124390687.309704.156800@g44g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 18 Aug 2005 20:52:49 GMT NNTP-Posting-Host: 141.154.216.240 X-Complaints-To: abuse@verizon.net X-Trace: trndny08 1124398369 141.154.216.240 (Thu, 18 Aug 2005 16:52:49 EDT) NNTP-Posting-Date: Thu, 18 Aug 2005 16:52:49 EDT Xref: g2news1.google.com comp.lang.ada:4171 Date: 2005-08-18T20:52:49+00:00 List-Id: Hyman Rosen wrote: > Ada types incorporate values that depend upon runtime values. > Array size is probably the simplest example - you can declare > an array inside a procedure whose size is determined by a > parameter to that procedure. I don't know Ada, but I'm pretty > sure that you can also have types whose discriminants are set > using values determined at runtime. As such, Ada types require > local storage (in principle) for their representation, and it > makes sense to free that storage once the scope in which the > type is declared is exited. C++ types never depend on runtime > values - they are always fully determined at compile time. > It is true that C++ types are static, but it is still possible to have scope problems with C++ exceptions, for example: class CBadException { public: int& m_Count; CBadException (int& Count) : m_Count (Count) {} }; void foo () { int Count; CBadException Expt (Count); throw Expt; // Expt now references Count, // which is going out of scope } -- "All things extant in this world, Gods of Heaven, gods of Earth, Let everything be as it should be; Thus shall it be!" - Magical chant from "Magical Shopping Arcade Abenobashi" "Drizzle, Drazzle, Drozzle, Drome, Time for the this one to come home!" - Mr. Lizard from "Tutor Turtle"