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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ccb707f4c91a5f2 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Invoking parental methods (was: Java vs Ada 95) Date: 1996/11/06 Message-ID: #1/1 X-Deja-AN: 194991045 references: organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-11-06T00:00:00+00:00 List-Id: In article <1996Nov5.112527.1@eisner> kilgallen@eisner.decus.org (Larry Kilgallen) writes: > My problem, again, is maintainability in the face of genealogy shifts. > Since Ada 95 does not have a mechanism to do it with zero changes > to the body in the fashion of Macintosh Object Pascal, I am hoping > for 1. I really feel that a 'SUPER attribute would make the language more useable, and maybe implementors will start providing it. However, until they do, we are stuck with the best solution being: For classes where you expect to need super, define: function Super(X: in Child) return Parent'Class; as a predefined operation. Now (with my hand never leaving my wrist), I can write Foobar(Super(Foob)); where it is not ambiguous, and Foobar(Bar'(Super(Foob))); if I have to disambiguate. The problem is I'd like to find an efficient way to define the Super function so that there are no accessability checks or the like and and you don't have to override it all the time. Any suggestions? (Writing it the other way round: function Super(X: in Child'Class) return Parent; has the "advantage" that the override is forced, but the disadvantage that you are much more likely to need a qualified expression.) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...