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.99.39.194 with SMTP id n185mr5402506pgn.122.1498256296563; Fri, 23 Jun 2017 15:18:16 -0700 (PDT) X-Received: by 10.157.12.161 with SMTP id b30mr261209otb.3.1498256296522; Fri, 23 Jun 2017 15:18:16 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!f20no409334itb.0!news-out.google.com!s132ni3207itb.0!nntp.google.com!185no409739itv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 23 Jun 2017 15:18:16 -0700 (PDT) In-Reply-To: <66aa262e-2ac9-4016-b32d-e9fee14779e1@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=68.114.51.240; posting-account=HN9B-woAAACqJDcuOavWYdk7s1Vm8fv7 NNTP-Posting-Host: 68.114.51.240 References: <1ac5a44b-4423-443a-a7bb-2864d9abe78f@googlegroups.com> <1498048151.20885.28.camel@obry.net> <96174ea5-852d-44e9-8535-7c1eb24d5326@googlegroups.com> <8d3aff06-82df-485f-89e5-a50c326aab05@googlegroups.com> <66aa262e-2ac9-4016-b32d-e9fee14779e1@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <88e2f18a-0786-4303-a5b8-fe82e8c81dcb@googlegroups.com> Subject: Re: Ada Annoyances From: pythoner6@gmail.com Injection-Date: Fri, 23 Jun 2017 22:18:16 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:47091 Date: 2017-06-23T15:18:16-07:00 List-Id: On Friday, June 23, 2017 at 2:56:09 PM UTC-4, Maciej Sobczak wrote: > In C++ it is always possible to do: >=20 > obj.SomeBaseClass::function(); >=20 > where obj is some reference, or: >=20 > ptr->SomeBaseClass::function(); >=20 > This means that it *is* possible to select T at the call site. Thanks for pointing this out. I had a feeling there was probably a way to d= o it, but I couldn't remember ever seeing the syntax for it. > There is one place where Ada is broken in this regard - Controlled types.= These should not be tagged. C++ got it right here. Out of curiosity, why should controlled types not be tagged? And how is C++= much different - other than that you can make destructors non-virtual (and= therefore never dynamically dispatch, though I think the advice I usually = see is to make almost all destructors virtual to avoid the case where the w= rong destructor gets called). > Interestingly, C++ got it right also by forcing the object type in constr= uctors and destructors - that is, you never see the object in a view that w= ould not be compatible with the lifetime of its parts. Ada does not do this= and it is a hole in the type system that can lead to serious errors. Again, I'm not quite sure I follow you here. What do you mean by "not compa= tible with the lifetime of its parts"?