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: Tue, 27 Jun 2017 09:26:21 +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> <71c4fdcd-4213-4b84-b852-c8674cfaf717@googlegroups.com> NNTP-Posting-Host: vZYCW951TbFitc4GdEwQJg.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 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:47139 Date: 2017-06-27T09:26:21+02:00 List-Id: On 26/06/2017 23:40, Randy Brukardt wrote: > "Maciej Sobczak" wrote in message > news:71c4fdcd-4213-4b84-b852-c8674cfaf717@googlegroups.com... > ... >>> In Ada, where redispatching requires explicit work, the vast >>> majority of constructors will never make a dispatching call so there is >>> very little risk. > >> The vast majority? Where does this statistics come from? > > Common sense. Constructors shouldn't be doing anything complicated in the > first place, so there's not much reason for delegation. This is an argument for type-specific constructors actually. You cannot have it both ways. And constructor could be quite complicated if you don't want to push initialization to the type's end user. In essence making an object fully functional is either a complication for the original designer of the type once declared or a complication for a user unfamiliar with the implementation details asked to bring half-baked object in order. I really hate APIs that require a dozen of calls to make plus some On_Init callbacks to handle before I could do anything with an object. [...] > As I tried to say yesterday, Ada does have a flaw in that allows dispatching > calls within contructors (and more generally, inside of any primitive > operations). That requires work of some sort, but it is possible, and it > shouldn't be. Hmm, but what are you going to do about Rosen's trick? All use-cases where it is used (to work around language problems, constructors included) must be eliminated first. Only then re-dispatch could (and must) be outlawed. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de