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,896d86ef3723978c X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: maintenance of overriding subprograms Date: 1997/09/05 Message-ID: #1/1 X-Deja-AN: 270147346 References: <340C2EA5.B9F@gsfc.nasa.gov> <341065D7.4D41@gsfc.nasa.gov> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-09-05T00:00:00+00:00 List-Id: In article <341065D7.4D41@gsfc.nasa.gov>, Stephen.Leake@gsfc.nasa.gov wrote: >However, in addition to the maintenance problem (I had a hidden >requirement :), I would like the source to give more immediate >indication that we are intending the subprogram to override a parental >one (and the others in the same spec do NOT). The presence/absence of >"new" or "pragma Confirm_Override" makes this clear. I think it makes >the source easier to read; one does not have to lookup all the primitive >parental procedures (a good tool would help, of course). This can be >done with comments, but those can get out of sync. Actually, this is one area where I thought the language designers were too conservative. I would have prefered that overriding subprograms be explictly designated as such, using a keyword as "override", ie type T is tagged private; procedure Op (O : T); type NT is new T with private; override procedure Op (O : NT); You should make the programmer assert his intent to override a primitive operation, so he doesn't do it accidently. This clearly documents which primitive operations of a derived type override those of its parent. -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271