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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2e2db8edf2656165 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Thu, 29 Sep 2005 17:17:22 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1lw8oz33ao529.12ep5ay7rg4oc$.dlg@40tude.net> <5-GdnRjCgYZOfKneRVn-qw@megapath.net> <3dachnu33lly.fpr0wvf6nj05$.dlg@40tude.net> <88m4nn9wh78b$.1wtlfwjymgcom.dlg@40tude.net> Subject: Re: Constructing an object Date: Thu, 29 Sep 2005 17:21:08 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-Y8PI4+IEBJcOcHYGrI54Kkek5L2ycr6hOLcMf6xx0v4+7MXhoSTUe66B7JjD9p9TgF1FyEIu+WPm8tQ!0hJE0lXcmCH3f4wRw09srA92Qt9ELudkE3akEUAj2BBbn4vCiVnSOKvxMdCuDDjN03ehxcH+7Zi7 X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:5284 Date: 2005-09-29T17:21:08-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:88m4nn9wh78b$.1wtlfwjymgcom.dlg@40tude.net... > On Wed, 28 Sep 2005 19:12:40 -0500, Randy Brukardt wrote: ... > This way, I believe, we could have constructors with arbitrary parameters > for all types. Interesting. I don't think that would work for Ada as it is currently defined, because we tried to do something like that in the implementation of the Janus/Ada compiler and it didn't work. I believe the problems had to do with composition (that is, calling the functions for the inner components of a record whose constraints depend on the outer constraints). But I don't remember all of the details. ... > >> Further, Ada needs extensible primitive and > >> class-wide operations, that could finally solve the construction / > >> assignment problem. > > > > I have no idea what this means; Ada has extensible primitive operations > > (indeed, *only* primitive operations can be extended). > > They aren't extensible in the sense that you can only override or inherit. > It is too dangerous for constructors and assignments. BTW, Ada does not to > completely override them anyway. For example the parts responsible for > initialization of the components cannot be overridden. One cannot have a > task component which will not start because Initialize does not call the > parent's one! (:-)) Ah, I see. Certainly you are right here. I see that a lot in Finalize routines; it is real easy to forget to call the Finalize for the parent type. There ought to be a better way of extending rather than replacing routines; that's especially true since requires an explicit type conversion to the parent to make that call, and it is easy to get wrong (and go infinitely recursive). No one proposed anything that would work, though. My syntax proposal (which predated the current generic_dispatching_constructor) tried to include that functionality, but it would have been a band-aid at best. This issue was never as high on the radar as others (like the user-defined T'Class'Input problem), so it didn't get handled. Randy.