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,dbcfe2b0a74da57e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!fdn.fr!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Inherited Methods and such Date: Wed, 26 Sep 2007 18:47:00 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1190239986.762473.204290@k79g2000hse.googlegroups.com> <1rw45b3rmvmcr$.1df4wst5oknbl$.dlg@40tude.net> <1190296353.624737.150940@y42g2000hsy.googlegroups.com> <11m13st1f92kf$.m8s6y8mc8ebk.dlg@40tude.net> <1190321119.206313.65290@57g2000hsv.googlegroups.com> <1190408526.100291.265040@50g2000hsm.googlegroups.com> <9ukf2wtqjs0q$.iuijmal4x56b$.dlg@40tude.net> <1190497995.498679.119190@19g2000hsx.googlegroups.com> <1mw3qju08q8uj.sgzht7ld9ydc$.dlg@40tude.net> <1190579805.451187.71140@d55g2000hsg.googlegroups.com> <1i8ksr774bjbj.vpmnx3c0i9qz.dlg@40tude.net> <1190646125.024072.310020@19g2000hsx.googlegroups.com> <1r9s9v6pcjifl.vp4ktk0unpd1.dlg@40tude.net> <1190753631.240548.101820@19g2000hsx.googlegroups.com> <1190842629.099822.65770@g4g2000hsf.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1190850254 10029 69.95.181.76 (26 Sep 2007 23:44:14 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 26 Sep 2007 23:44:14 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Xref: g2news2.google.com comp.lang.ada:2153 Date: 2007-09-26T18:47:00-05:00 List-Id: "Maciej Sobczak" wrote in message news:1190842629.099822.65770@g4g2000hsf.googlegroups.com... > On 26 Wrz, 14:21, Robert A Duff wrote: > > > Is this something fundamentally broken about constructors, > > or is just another case of uninitialized variables? > > I mean, there are lots of other ways to create uninit vars > > in Ada... > > Yes, but for most of them it is easy to analyze the code and spot the > problem. > Most of them can be even found by the compiler itself, without > involving any human-driven code review. > > Here the problem is in the interaction between base and derived type. > The important feature of OO is that implementations (bodies) for T and > S might not be available for review at the same time. If you look at T > in isolation, it's clean. If you look at S in isolation (and this is > the only thing you can do if you have only the interface ot T without > the implementation), it's clean as well. > Somehow together they don't work. No, the problem is quite obviously with T. (Re)-dispatching within Initialize is a sure-fire way to have a disaster. (A recent discussion on the ARG list showed this again with dispatching calls in an extended return statement.) OTOH, any program with such code in it is wrong. It's unfortunate that there isn't a way for the language to disallow such dispatching (as Initialize is an ordinary subprogram, after all). The same is true inside of extended return statements. I wouldn't go as far as Dmitry and disallow all redispatching, but it surely should not happen until the object is fully constructed. (I suspect the same is true while it is being finalized, but whether there is a real problem is not as obvious.) Randy.