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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,436e4ce138981b82 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-15 06:39:41 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news.octanews.net!ash.uu.net!spool.news.uu.net!not-for-mail Date: Mon, 15 Mar 2004 09:39:24 -0500 From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: abstract sub programs overriding References: <1078776213.376775@master.nyc.kbcfp.com> <1078839257.157439@master.nyc.kbcfp.com> <5cmr40t76va200betf07b7bd6er05ltto9@4ax.com> <1078845298.702789@master.nyc.kbcfp.com> <0ipr40thtf86b520a0qdi003aj87gtuhd4@4ax.com> <1078849973.701176@master.nyc.kbcfp.com> <1078924150.268074@master.nyc.kbcfp.com> <1078934469.744922@master.nyc.kbcfp.com> <1078949096.760629@master.nyc.kbcfp.com> <1079013337.572283@master.nyc.kbcfp.com> <9_mdnfzBlfEC3M_d4p2dnA@comcast.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1079361579.900651@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1079361579 21064 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:6332 Date: 2004-03-15T09:39:24-05:00 List-Id: Robert I. Eachus wrote: > If you look at what I was talking about I think I still don't understand. If you say 'a := b;' and a has a Controlled type, isn't Finalize called on a before its bits are clobbered? So in your Initilaize example, when you say 'Object := (Parent_Type with ...);', isn't Finalize called on Object before its bits are replaced with the extension aggregate? And since we're in the first Initialize of Object, doesn't that mean that Finalize will be called on it before its first Initialize is complete? > However if the Initialize for the parent type is called by the > Initialize for the child type, and you do this, it is the child's > subprogram that will be called. (The dispatching will look at the > actual tag, not at the designated type.) And as I said, don't do that. > It can be made to work, but in general it is not what you want, and the > extra work at compile time (or during debugging) to resolve ABE (access > before elaboration) problems just isn't worth it. Yes, exactly! This is what I have been getting at all along. And what I've also been saying is that C++ enforces the "don't do that" by dispatching to the parent type instead of to the child type in constructors. It does that by dynamically altering the tag (in Ada terms) of the object during the construction and destruction process. (C++ is in a more complex situation than Ada here becuase of multiple and virtual inheritance cases.) But in doing so, it rubs DK the wrong way, because his philosophy requires objects to never change their type dynamically. > Oh, they'll get ya. The point I keep trying to make is that only > language lawyers and compiler vendors should worry about those cases. Sure, but who else hangs out on c.l.a.? :-)