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.200.51.244 with SMTP id d49mr9134402qtb.45.1498390401399; Sun, 25 Jun 2017 04:33:21 -0700 (PDT) X-Received: by 10.157.54.246 with SMTP id s51mr169361otd.5.1498390401358; Sun, 25 Jun 2017 04:33:21 -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!v31no623371qtb.0!news-out.google.com!k7ni2036itk.0!nntp.google.com!185no1007214itv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 25 Jun 2017 04:33:21 -0700 (PDT) In-Reply-To: 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> <66aa262e-2ac9-4016-b32d-e9fee14779e1@googlegroups.com> <88e2f18a-0786-4303-a5b8-fe82e8c81dcb@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4ad48635-aa1e-45bf-8693-1f77d5fee490@googlegroups.com> Subject: Re: Ada Annoyances From: Maciej Sobczak Injection-Date: Sun, 25 Jun 2017 11:33:21 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:47109 Date: 2017-06-25T04:33:21-07:00 List-Id: > For T substitute Abstract_TCP_Server. For Bar substitute=20 > Get_IP_Address_To_Listen. And I still don't see any benefit. Can you explain what functionality is av= ailable in this scheme (and that is not available currently in Ada or C++)? > > Wrong. > > C++ does not kill any dispatching anywhere. Calls to virtual functions = from constructors/destructors are dispatching. >=20 > That is just same plus heating of the environment. You are running out of arguments. Calls to virtual functions while the object is during construction need to = work like usual, because they need not be done from the constructor: void useObject(Base & obj) { obj.foo(); // dispatching call to foo() } Base::Base() { // some initialization ... useObject(*this); } Derived::Derived() { // some initialization ... useObject(*this); } The useObject function does not know what it gets as an argument and we wan= t it to dispatch to the most specific part, but surely we do not want it to= dispatch to the parts that do not yet exist. Most importantly, useObject d= oes not know that it gets called from constructors, because it might be cal= led from any other context as well. It might be even in a different transla= tion unit. This shows that dispatching is *not* "killed" and whatever environment heat= ing takes place, it is needed, like in any other place where dispatching is= considered useful. We can discuss the useless environment heating imposed = by Controlled in Ada, instead. I understand that it is beyond the threshold of humiliation for a die-hard = Ada programmer, but I personally don't find it difficult to admit that this= is the part that C++ got right. --=20 Maciej Sobczak * http://www.inspirel.com