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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a02:5a48:: with SMTP id v69-v6mr6606982jaa.13.1529376358744; Mon, 18 Jun 2018 19:45:58 -0700 (PDT) X-Received: by 2002:aca:5208:: with SMTP id g8-v6mr611655oib.1.1529376358622; Mon, 18 Jun 2018 19:45:58 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!85.12.16.68.MISMATCH!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!d7-v6no5431425itj.0!news-out.google.com!z3-v6ni6897iti.0!nntp.google.com!d7-v6no5431421itj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 18 Jun 2018 19:45:58 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.113.16.86; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 76.113.16.86 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: <3e410d4c-60d9-4adf-82fe-5d6b2272804e@googlegroups.com> Subject: Re: Ada Successor Language From: Shark8 Injection-Date: Tue, 19 Jun 2018 02:45:58 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 4269 X-Received-Body-CRC: 2571511386 Xref: reader02.eternal-september.org comp.lang.ada:53154 Date: 2018-06-18T19:45:58-07:00 List-Id: On Monday, June 18, 2018 at 4:23:41 PM UTC-6, Dmitry A. Kazakov wrote: > On 2018-06-18 23:20, Shark8 wrote: > > On Monday, June 18, 2018 at 2:45:39 PM UTC-6, Niklas Holsti wrote: > >> On 18-06-18 23:22 , Jeffrey R. Carter wrote: > >>> On 06/18/2018 09:16 PM, Niklas Holsti wrote: > >>>> > >>>> Nah... invites "Ada'Succ sucks". > >>> > >>> Also, in Ada, Ada'Succ is not the successor of Ada. > >> > >> But perhaps the successor language will let us write X'Succ as an > >> abbreviation of X_Type'Succ(X) ... similarly to the recent introductio= n > >> of X'Image. > >=20 > > I'd honestly like the ability to use X'Type; this would allow us to say= something 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.= But that's not entirely the point, the point is that this allows the decla= ration 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. >=20 > It is not a little thing. It requires classes for all types. No, it doesn't. A 'Type attribute could simply mean "the [sub]type of this object", and the= reby given "A : Positive" we know that A'Type is positive, statically, at c= ompile time, and without any notion of classes. >=20 > Then all types with assignment (non-limited types) will be members of=20 > the class Not_Limited [*]. E.g. >=20 > type Integer is ... and Not_Limited; > type String is ... and Not_Limited; > ... Why would they need to have a Not_Limited class? We already know they're no= t limited from the type declaration "Type Integer is new System.Integer;"..= . We can currently use the generic-language "type T (<>) is abstract tagged l= imited private;" to specify "Any tagged type, abstract or concrete, limited= or not." > Then you could write a class-wide Swap: >=20 > procedure Swap (A, B : in out Not_Limited'Class) is > Temp : constant Not_Limited'Class :=3D B; > begin > B :=3D A; > A :=3D Temp; > end Swap; >=20 > ----------------------------- > * You must also deal with type cloning, so that >=20 > type X is new Integer; >=20 > will get its own copy of the Not_Limited class. I.e. the whole type tree= =20 > must be copied. It is not a little thing. Why would it need a Not_Limited class? It looks like you're trying to combi= ne regular "Interface" with the attributes-and-classification of the type.