TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: Corey Minyard <[log in to unmask]>
Date: Wed, 14 Oct 1998 19:59:54 -0500
In-Reply-To: Larry Hazel's message of Wed, 14 Oct 1998 12:56:59 -0500
Parts/Attachments: text/plain (46 lines)
Larry Hazel <[log in to unmask]> writes:

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

I would prefer a more direct implementation, too.  I'm not too sure
about the syntax above, but it's not too bad and supports backwards
compatibility.  The pragma is too much work and is also prone to
mispelling (although not nearly as badly as the original problem, of
course).  Although I'd use it if I had it.

This is on my "list" of things I'd like to have fixed in Ada (and
every other OOPL I've used, for this one :-).

--
Corey Minyard               Internet:  [log in to unmask]
  Work: [log in to unmask]       UUCP:  [log in to unmask]

ATOM RSS1 RSS2