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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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.13.201 with SMTP id j9mr2309265pbc.23.1316544546507; Tue, 20 Sep 2011 11:49:06 -0700 (PDT) Path: lh7ni1286pbb.0!nntp.google.com!news1.google.com!postnews.google.com!cd4g2000vbb.googlegroups.com!not-for-mail From: ytomino Newsgroups: comp.lang.ada Subject: Re: discriminant questions Date: Tue, 20 Sep 2011 11:47:50 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <708a1202-d480-451b-9b55-00b31ad9c452@w28g2000yqw.googlegroups.com> <1kx7ltnsal62q.195k449mr947t.dlg@40tude.net> <1axnuyk0kn2ru.cda1cs7skqcr$.dlg@40tude.net> NNTP-Posting-Host: 118.8.62.179 Mime-Version: 1.0 X-Trace: posting.google.com 1316544546 11484 127.0.0.1 (20 Sep 2011 18:49:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 20 Sep 2011 18:49:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: cd4g2000vbb.googlegroups.com; posting-host=118.8.62.179; posting-account=Mi71UQoAAACnFhXo1NVxPlurinchtkIj User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HNKUARELSC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.163 Safari/535.1,gzip(gfe) Xref: news1.google.com comp.lang.ada:18053 Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-09-20T11:47:50-07:00 List-Id: > 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? Yes, formal type can have [aspect_specification]. http://www.ada-auth.org/standards/12rm/html/RM-12-5.html And it's related only to syntax. If formal type can not have aspect, we can write ".Element.all" like Georg Bauhaus wrote. > 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. There is an illogical jump in what you say. The problem is just that Reference/Constant_Reference can be used in generic, or not. And it's tiny problem. If Reference/Constant_Reference can not be used in generic after all, I will use Element or Query_Element as before.