From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Lower bounds of Strings Date: Tue, 12 Jan 2021 10:37:41 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <1cc09f04-98f2-4ef3-ac84-9a9ca5aa3fd5n@googlegroups.com> <37ada5ff-eee7-4082-ad20-3bd65b5a2778n@googlegroups.com> NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61108 List-Id: On 2021-01-12 09:19, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:rtc1vu$1cfj$1@gioia.aioe.org... > ... >> Of course it will simplify everything. E.g. our beloved generics. Compare >> >> generic >> type I is (<>); >> type E is private; >> type A is array (I range <>) of E; >> >> with >> >> generic >> type A is new Root_Array_Type with private; > > Surely, it simplifies it to uselessness. You haven't declared the index and > component types here. It is a different issue, same like T and T'Class. You can get T'Class type from T. So there should be A'Index and A'Element type-valued attributes to get the companion types. In the traditional syntax: generic type A is array (<>) of <>; package Foo is subtype I is A'Index; subtype E is A'Element; > And if they are implicit in Root_Array_Type, you've > now run into the fundemental problem of interfaces: you need a generic or > everything has to be related in order to use an interface. Not fundamental, we just need Ada 83 "new" back: type S is new new T with private; -- Ada 83 new on top of Ada 95 new (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de