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.237.62.207 with SMTP id o15mr4831460qtf.76.1498244168704; Fri, 23 Jun 2017 11:56:08 -0700 (PDT) X-Received: by 10.157.66.43 with SMTP id q43mr194958ote.16.1498244168656; Fri, 23 Jun 2017 11:56:08 -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!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!v31no213143qtb.0!news-out.google.com!k7ni299itk.0!nntp.google.com!185no339031itv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 23 Jun 2017 11:56:08 -0700 (PDT) In-Reply-To: <8d3aff06-82df-485f-89e5-a50c326aab05@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=213.108.152.51; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S NNTP-Posting-Host: 213.108.152.51 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <66aa262e-2ac9-4016-b32d-e9fee14779e1@googlegroups.com> Subject: Re: Ada Annoyances From: Maciej Sobczak Injection-Date: Fri, 23 Jun 2017 18:56:08 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2670 X-Received-Body-CRC: 242310843 Xref: news.eternal-september.org comp.lang.ada:47088 Date: 2017-06-23T11:56:08-07:00 List-Id: > 3. The ONLY thing that differs is the granularity of how you choose to di= spatch or not. In C++, this choice is made by the method's implementer. In = Ada, it is made at the call-site by every caller. In C++ it is always possible to do: obj.SomeBaseClass::function(); where obj is some reference, or: ptr->SomeBaseClass::function(); This means that it *is* possible to select T at the call site. The implementer selects whether the function is virtual (dispatching) or no= t, but this is not much different from what Ada programmer can do by using = T or T'Class in operation's signature. In other words, you can implement the same object-oriented design in both l= anguages. The syntax will differ, but the "philosophical" differences are g= reatly exaggerated here. There is one place where Ada is broken in this regard - Controlled types. T= hese should not be tagged. C++ got it right here. Interestingly, C++ got it right also by forcing the object type in construc= tors and destructors - that is, you never see the object in a view that wou= ld not be compatible with the lifetime of its parts. Ada does not do this a= nd it is a hole in the type system that can lead to serious errors. --=20 Maciej Sobczak * http://www.inspirel.com