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:a24:f6c3:: with SMTP id u186-v6mr6629387ith.15.1529422502798; Tue, 19 Jun 2018 08:35:02 -0700 (PDT) X-Received: by 2002:a9d:6218:: with SMTP id g24-v6mr753450otj.4.1529422502701; Tue, 19 Jun 2018 08:35:02 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!d7-v6no146408itj.0!news-out.google.com!c20-v6ni61itc.0!nntp.google.com!d7-v6no146407itj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 19 Jun 2018 08:35:02 -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: Subject: Re: Ada Successor Language From: Shark8 Injection-Date: Tue, 19 Jun 2018 15:35:02 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:53163 Date: 2018-06-19T08:35:02-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.