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-Received: by 2002:a6b:6d19:: with SMTP id a25-v6mr5755050iod.16.1529357232218; Mon, 18 Jun 2018 14:27:12 -0700 (PDT) X-Received: by 2002:aca:d60f:: with SMTP id n15-v6mr586052oig.6.1529357232083; Mon, 18 Jun 2018 14:27:12 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!85.12.16.68.MISMATCH!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u78-v6no5167479itb.0!news-out.google.com!z3-v6ni6600iti.0!nntp.google.com!d7-v6no5195609itj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 18 Jun 2018 14:27:11 -0700 (PDT) In-Reply-To: <776f3645-ed0c-4118-9b4d-21660e3bba4b@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=23.91.139.164; posting-account=FIrIqgoAAAAbYWMmVdbV5-vsuCUTq8lA NNTP-Posting-Host: 23.91.139.164 References: <5e86db65-84b9-4b5b-9aea-427a658b5ae7@googlegroups.com> <878t7u1cfm.fsf@nightsong.com> <776f3645-ed0c-4118-9b4d-21660e3bba4b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Ada Successor Language From: ric.wai88@gmail.com Injection-Date: Mon, 18 Jun 2018 21:27:12 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2748 X-Received-Body-CRC: 3275610115 Xref: reader02.eternal-september.org comp.lang.ada:53147 Date: 2018-06-18T14:27:11-07:00 List-Id: 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 s= omething like this: >=20 > Procedure Swap( A, B : in out Some_Type ) is > Temp : Constant B'Type :=3D B; > Begin > B:=3D A; > A:=3D Temp; > End Swap; >=20 > Yeah, I know, it's a little thing and you can do it with generics, etc. B= ut that's not entirely the point, the point is that this allows the declara= tion of types dependent on objects... it provides some of the niceties of t= ype-inference without having to resort to such lazy/possibly-error-prone me= thodologies. 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 So= me_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. Your example above has no purpose. It would be better in ever single respec= t to just say: Temp: constant Some_Type :=3D B; Any other case where you wouldn't know about the type until runtime is exac= tly what generics are for.