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-Thread: 103376,735c710b5e547bad X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.201.129 with SMTP id ka1mr1075013pbc.4.1343469044623; Sat, 28 Jul 2012 02:50:44 -0700 (PDT) Path: c10ni45478pbw.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: Ada 2005 puzzle Date: Sat, 28 Jul 2012 02:48:43 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <1arp60wtxes8h$.1qs6bt732ztgp.dlg@40tude.net> <030cde76-7435-405d-9f12-ac7f730ecab8@googlegroups.com> <1f9q6vk5z2r3t$.1hayo9rmxfwu7$.dlg@40tude.net> <1agfifqlayl3y.1bp09z5i37ewk$.dlg@40tude.net> <1nnq1oprn6h4f.1s5myl3oupdds$.dlg@40tude.net> <57ed1bca-b503-492c-a3b1-012369484e93@googlegroups.com> <1gt5njrqzprkt$.1f9deqqcwyyuq.dlg@40tude.net> <1g6eygs4wyie8.x1sl1gap1gec$.dlg@40tude.net> <16ft4hb6xzphu.z8f7urnw3xu0.dlg@40tude.net> <50128262$0$6554$9b4e6d93@newsspool4.arcor-online.net> <1x51ztmeo2hll.jtsosl0kzzhi.dlg@40tude.net> NNTP-Posting-Host: 91.7.125.76 Mime-Version: 1.0 X-Trace: posting.google.com 1343469044 19070 127.0.0.1 (28 Jul 2012 09:50:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 28 Jul 2012 09:50:44 +0000 (UTC) Cc: mailbox@dmitry-kazakov.de In-Reply-To: <1x51ztmeo2hll.jtsosl0kzzhi.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.7.125.76; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-07-28T02:48:43-07:00 List-Id: On Friday, July 27, 2012 3:04:12 PM UTC+2, Dmitry A. Kazakov wrote: > If you cannot derive? Primitive operations make little sense if there is > only one type. > > Abstract types fall short either because you could not have: > > type T is abstract ... with private; > function Create (...) return T; -- Non-abstract > -- initializes private parts of T, called from the overriding > > The stuff just does not make any sense to me. I see what you mean. But since no objects of abstract types may exist and s= omehow you have to provide the private components of derived nonprivate obj= ects, the proper Ada way (as intended by ARG, I guess) is child packages. T= hey can see the private part and provide the necessary information. (I'm su= re you know this.) So you *can* derive: package Root is type T is abstract tagged private; private ... end Root; package Root.Child is -- body can see private part of Root type S is new T with private; function Create (...) return S; private ... end Root.Child; -- I guess that's what you want: with Root; package Derived is -- this does not work, there's no way to provide the -- private part of T. type S is new Root.T with private; function Create (...) return S;