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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada Annoyances Date: Sun, 25 Jun 2017 16:32:17 +0200 Organization: Aioe.org NNTP Server Message-ID: 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> <4ad48635-aa1e-45bf-8693-1f77d5fee490@googlegroups.com> NNTP-Posting-Host: MajGvm9MbNtGBKE7r8NgYA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:47111 Date: 2017-06-25T16:32:17+02:00 List-Id: On 2017-06-25 13:33, Maciej Sobczak wrote: > >> For T substitute Abstract_TCP_Server. For Bar substitute >> Get_IP_Address_To_Listen. > > And I still don't see any benefit. It is frequently used design pattern to leave some parts of construction used by the parent type to the children. > Can you explain what > functionality is available in this scheme (and that is not available > currently in Ada or C++)? In Ada one uses a class-wide operation dispatching to the construction call (Get_IP_Address_To_Listen) and a comment that Initialize must call it or else the parent's Initialize (which calls it too) if overridden. Since Ada's Initialize is called late it is OK to dispatch from there. C++ which calls its initializers early. The point is that construction requires both early (type-specific) and late (class-wide) initializers. [...] > Most importantly, useObject does not know that it gets called from > constructors, because it might be called from any other context as well. > It might be even in a different translation unit. > > This shows that dispatching is *not* "killed" and whatever > environment heating takes place, I don't see how it shows that, or anything. > 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. The only right thing are type-specific constructors. Everything else in the C++ construction model is wrong. And it is not in Ada's favor. Ada's user-construction model is wrong too. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de