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 Path: g2news1.google.com!news1.google.com!proxad.net!134.158.69.22.MISMATCH!in2p3.fr!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Constructing an object Date: Fri, 30 Sep 2005 10:14:47 +0200 Organization: Adalog Message-ID: References: <1lw8oz33ao529.12ep5ay7rg4oc$.dlg@40tude.net> <5-GdnRjCgYZOfKneRVn-qw@megapath.net> <3dachnu33lly.fpr0wvf6nj05$.dlg@40tude.net> <88m4nn9wh78b$.1wtlfwjymgcom.dlg@40tude.net> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1128070983 23199 195.25.228.57 (30 Sep 2005 09:03:03 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 30 Sep 2005 09:03:03 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: fr, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:5306 Date: 2005-09-30T10:14:47+02:00 List-Id: Randy Brukardt a �crit : > "Dmitry A. Kazakov" wrote in message >>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). > I think CLOS has such a feature, but it raises an issue: sometimes you want to call the parent Finalize *before* your own Finalize, sometimes *after*. If it is automatic, you must force one of them, which makes problems if you want the other one. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr