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!news3.google.com!news.glorb.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: Fri, 30 Sep 2005 19:40:37 -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: Fri, 30 Sep 2005 19:44:22 -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-Vdf+vGcD/kMvIC8C6iPUwIB9FUvekfO+VlpFc4rtlG8QsA8D/Nv68FufhgE4id9pReyghPVKA1q9HyA!2dww3tpBGgBst4NRIFgLNp9MWYXwUASiJQKu4b4ON+h/scNLLxaadlNizw9ZvL4mygpyMW0nW1U2 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:5318 Date: 2005-09-30T19:44:22-05:00 List-Id: "Robert A Duff" wrote in message news:wccirwi30q7.fsf@shell01.TheWorld.com... ... > 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. Yes, of course it should work everywhere. Finalize routines were just an example of a routine that needs it. Actually, it wouldn't be that hard to add that to Ada 200Y. We have the "overriding" keyword to specify overriding. Additional keywords could specify other types of extension -- "extends" perhaps. That would look like: extends procedure Finalize (Obj : in out My_Type); or perhaps extends after procedure Finalize (Obj : in out My_Type); to specify when the parent routine is called. But I think that we'd only want to support calling the parent routine first or last; special syntax for calling it in the middle hardly seems worth it (and getting the parameters right then would be messy - calling the parent last could be done with jumps, and first probably also could be done with shared code). I'm mildly sorry I didn't think of this when we were working on "overrides"; its a rather natural extension to the idea that also helps to prevent bugs. Randy.