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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,436e4ce138981b82 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-12 10:11:45 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!dialin-145-254-038-226.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: abstract sub programs overriding Date: Fri, 12 Mar 2004 19:19:28 +0100 Organization: At home Message-ID: References: <1078849973.701176@master.nyc.kbcfp.com> <1078924150.268074@master.nyc.kbcfp.com> <1079014276.527406@master.nyc.kbcfp.com> <67u0505uu3gfmlt8p28e9jkaco0nljquut@4ax.com> <1079019616.621636@master.nyc.kbcfp.com> <1079026002.840030@master.nyc.kbcfp.com> <1079097006.572713@master.nyc.kbcfp.com> <1079103394.507060@master.nyc.kbcfp.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-038-226.arcor-ip.net (145.254.38.226) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de 1079115104 66883631 I 145.254.38.226 ([77047]) User-Agent: KNode/0.7.2 Xref: archiver1.google.com comp.lang.ada:6279 Date: 2004-03-12T19:19:28+01:00 List-Id: Hyman Rosen wrote: > Dmitry A. Kazakov wrote: >> C++ does everything right and anything else is not Ada. > > This has nothing to do with programming language wars, > but perhaps with English language wars. When you state > categorically "So when T is view-convertible to T'Class, > then two constructors have to be applied: one of T, one > of T'Class. In the constructor of T you cannot dispatch, > in the constructor of T'Class you can do it safely." it > certainly sounds like you are saying that this is what > Ada does. But this is not what Ada does, it is what you > would like Ada to do. No it is how Ada does it. Here is an example: package Foo is type A is new Ada.Finalization.Controlled with null record; procedure Initialize (Object : in out A); type In_B is new Ada.Finalization.Controlled with null record; procedure Initialize (Object : in out In_B); type B is new A with record Field : In_B; end record; end Foo; with Ada.Text_IO; use Ada.Text_IO; package body Foo is procedure Initialize (Object : in out A) is begin Put_Line ("Init A"); end Initialize ; procedure Initialize (Object : in out In_B) is begin Put_Line ("Init field of B"); end Initialize; end Foo; Initializing of an object of B will print: Init field of B Init A showing that Initialize for A is called *after* initialization of Field of B. It means that A's Initialize may safely use any field of B. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de