comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: overriding in private part
Date: Sun, 05 Oct 2008 15:57:48 -0400
Date: 2008-10-05T15:57:48-04:00	[thread overview]
Message-ID: <wcck5cm24sj.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1vlrayvqx3imy.cp250cnppen5.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On Sat, 04 Oct 2008 15:47:04 -0400, Robert A Duff wrote:
>
>> If you use a compiler that warns on missing "overriding", then you don't
>> need to say "not overriding", because that's the default -- any
>> subprogram that doesn't say "overriding" is not overriding.
>> Saying "not overriding" is just noise.
>
> [...] 
>
>> I agree that if you want an indicator on every subprogram declaration,
>> then forbidding "no overriding" on some non-overriding subprograms is a
>> language design mistake.  But I don't want that -- I want a safe
>> (non-overriding) default.
>
> But non-overriding is unsafe. Taking your example with in and in-out, when
> the programmer uses in instead of in-out, that does not change the program
> semantics, so long the program remains legal. Otherwise (if the body
> actually changes the parameter) it will not compile. This is safe.

Good point, but I'm only half convinced.  If you get in the habit of
always saying "overriding" when appropriate, and you use the warnings,
then you're unlikely to get into trouble.  And the idea of putting "not
overriding" all over the place seems awfully verbose, to me.

- Bob



  reply	other threads:[~2008-10-05 19:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 15:49 overriding in private part Maxim Reznik
2008-10-02 16:42 ` Adam Beneschan
2008-10-03  8:52   ` Dmitry A. Kazakov
2008-10-03 15:54     ` Adam Beneschan
2008-10-03 20:29       ` Robert A Duff
2008-10-04  2:28         ` Randy Brukardt
2008-10-04 19:47           ` Robert A Duff
2008-10-05  7:35             ` Dmitry A. Kazakov
2008-10-05 19:57               ` Robert A Duff [this message]
2008-10-06  8:50                 ` Dmitry A. Kazakov
2008-10-06 23:32                   ` Randy Brukardt
2008-10-05 11:46             ` stefan-lucks
2008-10-05 20:08               ` Robert A Duff
2008-10-06 23:39                 ` Randy Brukardt
2008-10-02 23:17 ` Randy Brukardt
replies disabled

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