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 10.66.162.202 with SMTP id yc10mr53299168pab.47.1435974743897; Fri, 03 Jul 2015 18:52:23 -0700 (PDT) X-Received: by 10.182.221.129 with SMTP id qe1mr251031obc.2.1435974743834; Fri, 03 Jul 2015 18:52:23 -0700 (PDT) Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!ff1no1937091igc.0!news-out.google.com!t2ni3436igk.0!nntp.google.com!ff1no1277110igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 3 Jul 2015 18:52:23 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=174.28.156.122; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 174.28.156.122 References: <4lrj5zz2u2z.u8x9cf7xzic6.dlg@40tude.net> <58f64fa9-7d0b-44dd-870c-77d9afcb82c4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4228c0ea-837d-42a0-b2a8-a98d8d30f820@googlegroups.com> Subject: Re: Ada design bug or GNAT bug? From: Shark8 Injection-Date: Sat, 04 Jul 2015 01:52:23 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.giganews.com comp.lang.ada:193902 Date: 2015-07-03T18:52:23-07:00 List-Id: On Thursday, July 2, 2015 at 6:04:50 PM UTC-6, Randy Brukardt wrote: >=20 > The reason Ada has anonymous access parameters was a desire (for Ada 9x)= =20 > that code from existing OOP languages like C++ could be directly converte= d=20 > to Ada without having to think at all (thinking being necessary to get ri= d=20 > of access types). Do you think, in hindsight that (anonymous access parameters) was a mistake= ? > [snip] > > > >One may think that the distinction between class type and tagged type is= =20 > >subtle, but the > >implications of it are huge : without class object one needs as replacem= ent=20 > >access to a > >class wide type. This has led to the use of access values everywhere whe= n=20 > >doing OOP. > >To ease the pain access parameters and anonymous access types were=20 > >introduced... >=20 > This seems to me to be nonsense. There's no need to use access types in A= da=20 > OOP interfaces; "in out T" and "access T" have virtually the same semanti= cs=20 > when T is a tagged type. (Claw only has one access type in its entire=20 > interface, used for a return type that ought to be by reference. Everythi= ng=20 > else does not use visible access types.) It's more work this way, but it'= s=20 > definitely possible. I think I remember getting an error-message in GNAT awhile back about retur= n and reference semantics... wasn't that something that Ada95 had but was l= ater forbidden in Ada 2005? -- Also, do you think it would have been better= to have extended-return signal to the compiler a desire for a build-in-pla= ce return-object? Also, I seem to recall your dislike of INTERFACEs -- in hindsight, what wou= ld you have done differently if you needed the mechanism of "Type T has fun= ctions X, Y, and X" applied to a group of types? Generics, or some variatio= ns thereof? >> with P1; use P1; >> package P2 is >> type T3 is new T1 with private; >> private >> type T3 is new T2 with null record; -- Legal! > >This is only legal because of a hack, which I was very much against introducing. If you have an extension component, this is illegal: > > type T4 is new T2 with record C : Character :=3D '1'; end record; -- = =20 Illegal!!! Why is this hack required?/How was it justified? How would you address the = problem w/o resorting to this hack? Other than those specifics, I'm quite interested to know what you regard to= be mistakes in Ada's design.