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,70414f56d810c10c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.44.102 with SMTP id d6mr2631847pbm.9.1316506117294; Tue, 20 Sep 2011 01:08:37 -0700 (PDT) Path: lh7ni989pbb.0!nntp.google.com!news1.google.com!news3.google.com!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: discriminant questions Date: Tue, 20 Sep 2011 10:08:18 +0200 Organization: cbb software GmbH Message-ID: <1axnuyk0kn2ru.cda1cs7skqcr$.dlg@40tude.net> References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <708a1202-d480-451b-9b55-00b31ad9c452@w28g2000yqw.googlegroups.com> <1kx7ltnsal62q.195k449mr947t.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:18042 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-09-20T10:08:18+02:00 List-Id: On Mon, 19 Sep 2011 10:49:18 -0700 (PDT), ytomino wrote: >> As a work-around, make the second package a child or pass the first one as >> a parameter to it. > > It means that we have to write plural versions of Generic_Count for > Vectors, for Doubly_Linked_Lists, for Ordered_Sets and more. Note that generics poison anything they touch. Every language feature need a generic counterpart, so not only the discriminants need to have corresponding formal generic parameter, but also the newly added aspect stuff. I don't know if Ada 2012 has formal generic implicit_dereference. Does it? Anyway the first step to do is generic package interfaces. If you want Vectors, Doubly_Linked_Lists etc to be used in a generic manner they shall implement an interface (a generic one, because the packages are generic). Ada lacks means to describe generic interfaces and to match generic packages against them. The whole idea of generic containers used for generic programming is not sustainable, sorry for delivering an inconvenient truth. If you want generic programming working do it on the class-wide basis. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de