comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: maintenance of overriding subprograms
Date: 1997/09/05
Date: 1997-09-05T00:00:00+00:00	[thread overview]
Message-ID: <341065D7.4D41@gsfc.nasa.gov> (raw)
In-Reply-To: dewar.873460404@merv


Robert Dewar wrote:
> 
> <<When we compile, the compiler tells us that the package body of Root
> does not have a corresponding body for Create. However, it does not tell
> us that Derived.Create no longer overrides Root.Create; Derived.Create
> silently changes from an overriding subprogram to a "normal" subprogram.
> >>
> 
> Actually I think a warning would be in order if a primitive procedure
> of a derived type matches the name (but not the signature) of a
> procedure of its parent.

That would solve the maintenance problem, while imposing the style
guideline that you should NOT give a subprogram the same name as a
parental procedure unless you are overriding it. This seems like a
reasonable guideline, and you could always disable the warning.

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.
-- 
- Stephe




  reply	other threads:[~1997-09-05  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-02  0:00 maintenance of overriding subprograms Stephen Leake
1997-09-05  0:00 ` Robert Dewar
1997-09-05  0:00   ` Stephen Leake [this message]
1997-09-05  0:00     ` Matthew Heaney
1997-09-07  0:00     ` Robert A Duff
1997-09-08  0:00       ` W. Wesley Groleau x4923
1997-09-09  0:00         ` Robert A Duff
1997-09-09  0:00           ` Jon S Anthony
1997-09-08  0:00       ` Tom Moran
1997-09-08  0:00         ` Stephen Leake
     [not found] ` <340DCE1D.6C5F@bix.com>
1997-09-04  0:00   ` John G. Volan
1997-09-07  0:00   ` Robert Dewar
1997-09-08  0:00     ` Robert A Duff
1997-09-09  0:00     ` Dan Johnston D.B.
1997-09-09  0:00       ` W. Wesley Groleau x4923
1997-09-09  0:00       ` Tom Moran
1997-09-10  0:00       ` Robert Dewar
1997-09-11  0:00         ` Dan Johnston D.B.
1997-09-12  0:00           ` Richard A. O'Keefe
1997-09-12  0:00             ` Samuel Mize
1997-09-18  0:00             ` Shmuel (Seymour J.) Metz
1997-09-24  0:00               ` John G. Volan
1997-09-25  0:00                 ` Shmuel (Seymour J.) Metz
1997-09-26  0:00                   ` Richard A. O'Keefe
1997-09-12  0:00           ` Robert Dewar
1997-09-10  0:00 ` Anonymous
  -- strict thread matches above, loose matches on Subject: below --
1997-09-10  0:00 Marc Wachowitz
1997-09-29  0:00 Marin David Condic, 561.796.8997, M/S 731-96
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox