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,2a3157e5254b8223 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Array slices and types Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <5886ab95-8744-4b72-b911-e4cb8889c7e7@d1g2000hsg.googlegroups.com> <1k5uib98w8fgw.bno6vggps1p3.dlg@40tude.net> <48ac6750$0$23587$4f793bc4@news.tdc.fi> <48acfbe8$0$23588$4f793bc4@news.tdc.fi> Date: Thu, 21 Aug 2008 10:53:50 +0200 Message-ID: NNTP-Posting-Date: 21 Aug 2008 10:53:52 CEST NNTP-Posting-Host: 6cbce974.newsspool1.arcor-online.net X-Trace: DXC=@k?hfi8AQT8L2C_`koXfC5ic==]BZ:af>4Fo<]lROoR14nDHegD_]R5gG`ClfbHhY8DNcfSJ;bb[5IRnRBaCd5;m3he=ol;5NXfNO_GQ]C9 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:1710 Date: 2008-08-21T10:53:52+02:00 List-Id: On Thu, 21 Aug 2008 08:26:26 +0300, Niklas Holsti wrote: > But doesn't this example show that it would be useful to have 'Base > also for array types? For any type, actually. Consider this language design fault: procedure Initialize (X : in out S) is begin Initialize (T (X)); ... -- My stuff end Initialize; A call to Initialize should be done automatically, but it is not. So the parent of S must be explicitly specified and known to all descendant. This is a really *bad* thing: package Foo is type S is new T with private; private type S is new Private_Decendant_Of_T with ...; end Foo; What would happen if Private_Decendant_Of_T overrode Initialize of T? The result would be an inability to publicly derive from S any new types if Initialize should be extended! S'Base could mend it: procedure Initialize (X : in out S) is begin (S"Base (X)).Initialize; -- Call to parent whatever it be ... -- My stuff end Initialize; Presently the only way is to override Initialize, Finalize and Adjust everywhere, even if you actually don't want to extend them: package Foo is type S is new T with private; overriding procedure Initialize (X : in out S); -- Have to do this! private type S is new Private_Decendant_Of_T with ...; end Foo; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de