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: G. B. Newsgroups: comp.lang.ada Subject: Re: Ada Successor Language Date: Tue, 19 Jun 2018 17:07:16 -0000 (UTC) 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> <6cae3e50-7f14-4839-b7cb-bd82cf11cbda@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 19 Jun 2018 17:07:16 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="a33f38588384ea41b8f1a0e26ac9a229"; logging-data="12601"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jGpy8tymUI+2OuV7Qbw9/xjNMro9RzcA=" User-Agent: NewsTap/5.3.1 (iPhone/iPod Touch) Cancel-Lock: sha1:U+ylp0NAWFejUgum8CXb+W3uwL4= sha1:u8wT2J1XL6FslKkS2IDhwHp7lL8= Xref: reader02.eternal-september.org comp.lang.ada:53165 Date: 2018-06-19T17:07:16+00:00 List-Id: Shark8 wrote: > On Tuesday, June 19, 2018 at 1:35:30 AM UTC-6, G. B. wrote: >> 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. >>> >> >> What is the ‘Size of B’Type? > > In the given case? > Since B'Type is Some_Type, B'Type'Size is exactly Some_Type'Size. > And the size of Some_Type is? Noting that the compiler can separately compile procedures for Some_Type which covers many different types... How does it work?