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!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!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: Thu, 27 Sep 2007 19:44:28 -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> <1190927328.753361.138630@d55g2000hsg.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1190940100 24539 69.95.181.76 (28 Sep 2007 00:41:40 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 28 Sep 2007 00:41:40 +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:2174 Date: 2007-09-27T19:44:28-05:00 List-Id: "Maciej Sobczak" wrote in message news:1190927328.753361.138630@d55g2000hsg.googlegroups.com... > On 27 Wrz, 01:47, "Randy Brukardt" wrote: > > > No, the problem is quite obviously with T. (Re)-dispatching within > > Initialize is a sure-fire way to have a disaster. > > 1. I don't have to redispatch from Initialize, I can do this from > subprogram S1, which was called from S2, which was called from ... SN, > which was called from Initialize. Of course, that's why it can't be banned. But it is still wrong. I would go so far as to suggest that *calling out* from Initialize with an object of the type (or an ancestor) is wrong (with the single exception of calling a parent's Initialize routine). But that might be going too far. (Still, that is a rule that could be implemented by a style checker; it wouldn't be possible for the language to do it because the body of Initialize doesn't have to be explicitly declared: it could be a rename of something that is used also for other purposes.). > 2. The fact that there is a disaster is exactly my point. The > interpretation differs, though. :-) Doing something stupid often causes disasters. Education is often needed to prevent them; it's not possible for a compiler to prevent them all. > > I wouldn't go as far as Dmitry > > and disallow all redispatching, but it surely should not happen until the > > object is fully constructed. > > Bingo. The only "issue" is that Ada does not acknowledge this > "progressive" nature of construction and there is no recognized place > for being not fully constructed. > > > (I suspect the same is true while it is being > > finalized > > Yes. The tag should progressively "degrade" during subsequent stages > of finalization. No reason for messing with the tag or doing it "progressively". If dispatching is wrong on Initialize, it is wrong in all of them, so it would be banned until construction is finished, and similarly during destruction. Construction and destruction are still single events: there is no interruption in those events to do other things. (Remember that finalization is even abort-deferred.) Even though the event of construction may include many operations, it's still indivisible from the point of view of the object. Randy.