TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Larry Hazel <[log in to unmask]>
Wed, 14 Oct 1998 12:56:59 -0500
text/plain (30 lines)
Tucker Taft wrote:

> Ben Brosgol wrote:
> > John Harbaugh wrote:
> >
> > >This illustrates a fundamental advantage of Ada:  It is difficult to
> > >write correct programs that have typos.
> >
> > I agree in general, but there is one pitfall in the case of OOP (which by
> > the way is not unique to Ada).  If you misspell the name of a subprogram
> > intended to override an otherwise implicitly inherited operation, then you
> > do not override it even  though you think you have.  ...
> A pragma like "pragma Overrides(...)" would seem to be a good thing
> to have here.  This should go on the "list" of useful pragmas for
> vendors to agree on...
> -Tuck

How about

  function new Financial_Aid ...

I know this would be a more drastic change than a pragma but it makes it
absolutely clear in the subprogram declaration that this is intended to override
an inherited function.

Larry Hazel