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!news.glorb.com!newscon02.news.prodigy.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Constructing an object Date: 30 Sep 2005 13:49:04 -0400 Organization: The World Public Access UNIX, Brookline, MA 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: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1128102544 5947 192.74.137.71 (30 Sep 2005 17:49:04 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 30 Sep 2005 17:49:04 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:5314 Date: 2005-09-30T13:49:04-04:00 List-Id: "Randy Brukardt" writes: > 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). The Common Lisp Object System has such a feature. You can declare methods that are called in addition to the parent's version (either before or after) rather than the more common feature of calling them instead of the parent's version. And I think there's a feature for declaring a method that must call the parent's version somewhere within it -- or something like that. If such additional complexity were to be added to Ada (I doubt it!), it would be a shame to make it work just for Initialize/Finalize. It really should be a general purpose feature. This need (where an overriding "should" call the parent) comes up a lot in OO code; Finalize is just a special case. - Bob