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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Ada Successor Language Date: Fri, 22 Jun 2018 13:14:46 +0200 Organization: A noiseless patient Spider Message-ID: References: <5e86db65-84b9-4b5b-9aea-427a658b5ae7@googlegroups.com> <878t7u1cfm.fsf@nightsong.com> <776f3645-ed0c-4118-9b4d-21660e3bba4b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 22 Jun 2018 11:14:46 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="8235a46afc0b888aeec67966111b2331"; logging-data="3908"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zWqX4a/6Hn6L5oXUPHi1h" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cancel-Lock: sha1:hB/83MYn9m3VC9wplsMsam3eY00= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:53245 Date: 2018-06-22T13:14:46+02:00 List-Id: On 18/06/2018 23:27, ric.wai88@gmail.com wrote: > On Monday, June 18, 2018 at 5:20:32 PM UTC-4, Shark8 wrote: > >> I'd honestly like the ability to use X'Type; this would allow us to say something like this: >> >> Procedure Swap( A, B : in out Some_Type ) is >> Temp : Constant B'Type := B; >> Begin >> B:= A; >> A:= Temp; >> End Swap; >> >> Yeah, I know, it's a little thing and you can do it with generics, etc. But that's not entirely the point, the point is that this allows the declaration of types dependent on objects... it provides some of the niceties of type-inference without having to resort to such lazy/possibly-error-prone methodologies. > > > Why would you want that? You have to have visibility to the type to declare an object of the type. In your above example, you explicitly know about Some_Type, and you also explicitly know that A and B are of that type. So you don't need to query the parameter, since it is implicit. I won't discuss the merit of the idea, but isn't C++11's "auto" doing this?