comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.invalid>
Subject: Re: Uninitialized out parameters.
Date: Thu, 07 Apr 2016 09:52:34 +0200
Date: 2016-04-07T09:52:34+02:00	[thread overview]
Message-ID: <ne53dt$tu1$1@dont-email.me> (raw)
In-Reply-To: <alpine.DEB.2.20.1604062240350.29458@debian>

On 06/04/16 22:53, Stefan.Lucks@uni-weimar.de wrote:
> If people really think they need to declare something like the above procedure X, a revised Ada standard could allow declarations such as
>
>      procedure X(Formal: T) is raise;
>
> and
>
>       function Y return T is raise;
>
> where "is raise" stands for "raise Program_Error". That may sometimes come handy in the context of inheritance, or so.


Two prominent use cases will suggest this hammer won't fly ;-)
if used as a replacement:

1. Testing, or integration builds at various incomplete stages:
    one couldn't test part B of a program if part A of the program,
    calling X, always raises before it gets to B.

2. OPENSTEP style programming (a.k.a. Cocoa) as an example, meaning
    that, conceptually, whenever an object is not (yet) defined (nil),
    but then receives a message, nothing happens.

So, if a procedure does nothing and out comes nothing,
then it doesn't do harm either, at least if programmers know what
to expect. They fill in the blanks later.

I'd rather accept null functions in the set of oddities of
Ada than be forced to always have finished everything.
Note that raising disallows stubs like

   procedure X (Formal : out T) is
   begin
       pragma Warning ("TODO: compute a value for out Formal!")
       null;
   end X;

Treating warnings as errors should help with strict rejection
rules where the projects demand them.


  parent reply	other threads:[~2016-04-07  7:52 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 12:02 Uninitialized out parameters ahlan
2016-04-05 13:17 ` rieachus
2016-04-05 14:07   ` ahlan
2016-04-06  9:45     ` Mark Lorenzen
2016-04-06 21:01       ` Jeffrey R. Carter
2016-04-07  7:10       ` ahlan
2016-04-05 16:19 ` G.B.
2016-04-06  8:19   ` ahlan
2016-04-06 10:17     ` G.B.
2016-04-06 11:44       ` Dennis Lee Bieber
2016-04-06 20:41         ` Niklas Holsti
2016-04-06 20:54         ` Randy Brukardt
2016-04-06 20:47       ` Randy Brukardt
2016-04-06 21:01         ` Randy Brukardt
2016-04-06 21:22           ` Dmitry A. Kazakov
2016-04-07  7:27             ` Randy Brukardt
2016-04-06 11:37 ` AdaMagica
2016-04-06 13:44   ` ahlan
2016-04-06 14:09     ` Mark Lorenzen
2016-04-06 14:10     ` G.B.
2016-04-06 20:53     ` Stefan.Lucks
2016-04-06 21:03       ` Randy Brukardt
2016-04-06 21:12       ` Niklas Holsti
2016-04-06 21:30       ` Randy Brukardt
2016-04-07  9:56         ` Stefan.Lucks
2016-04-07 16:08           ` AdaMagica
2016-04-07 23:02             ` Randy Brukardt
2016-04-08  7:32               ` Dmitry A. Kazakov
2016-04-07  7:52       ` Georg Bauhaus [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-07-29  0:00 W. Wesley Groleau (Wes)
1996-07-18  0:00 Uninitialized "out" parameters Paul Whittington
1996-07-18  0:00 ` Adam Beneschan
1996-07-18  0:00   ` Robert Dewar
1996-07-19  0:00   ` Dale Stanbrough
1996-07-19  0:00     ` Adam Beneschan
1996-07-19  0:00     ` James A. Squire
1996-07-19  0:00       ` Adam Beneschan
1996-07-20  0:00       ` Michael Feldman
1996-07-21  0:00         ` Fergus Henderson
1996-07-21  0:00           ` Michael Feldman
1996-07-21  0:00             ` Robert Dewar
1996-07-22  0:00             ` Fergus Henderson
1996-07-23  0:00               ` Michael Feldman
1996-07-23  0:00                 ` Robert Dewar
1996-07-25  0:00                   ` Fergus Henderson
1996-07-24  0:00                 ` Robert A Duff
1996-07-25  0:00                   ` Richard A. O'Keefe
1996-07-24  0:00                 ` Fergus Henderson
1996-07-19  0:00   ` Samuel Tardieu
1996-07-19  0:00     ` John Herro
1996-07-19  0:00       ` Tucker Taft
1996-07-23  0:00         ` Peter Hermann
1996-07-23  0:00           ` Robert A Duff
1996-07-19  0:00   ` Pascal Obry
1996-07-19  0:00     ` Peter Hermann
1996-07-18  0:00 ` Robert Dewar
1996-07-19  0:00   ` Peter Amey
1996-07-20  0:00   ` Fergus Henderson
1996-07-20  0:00     ` Robert Dewar
1996-07-21  0:00       ` Fergus Henderson
1996-07-21  0:00         ` Robert Dewar
1996-07-23  0:00           ` Fergus Henderson
1996-07-23  0:00             ` Robert A Duff
1996-07-24  0:00               ` Fergus Henderson
1996-07-24  0:00               ` Fergus Henderson
1996-07-23  0:00           ` Richard A. O'Keefe
1996-07-23  0:00             ` Robert Dewar
1996-07-24  0:00               ` Robert A Duff
1996-07-24  0:00               ` Fergus Henderson
1996-07-24  0:00               ` Fergus Henderson
1996-07-25  0:00               ` Richard A. O'Keefe
1996-07-25  0:00                 ` Robert A Duff
1996-07-23  0:00             ` Robert A Duff
1996-07-24  0:00               ` Richard A. O'Keefe
1996-07-24  0:00                 ` Theodore E. Dennison
1996-07-24  0:00                 ` Robert A Duff
1996-07-25  0:00                   ` Richard A. O'Keefe
1996-07-25  0:00                     ` Robert A Duff
1996-07-25  0:00                 ` Frank Manning
1996-07-25  0:00                   ` Richard A. O'Keefe
1996-07-26  0:00                     ` Frank Manning
1996-07-19  0:00 ` Peter Amey
1996-07-19  0:00 ` Michel Gauthier
1996-07-21  0:00   ` Robert A Duff
1996-07-21  0:00 ` Robert A Duff
1996-07-23  0:00 ` John Herro
1996-07-23  0:00   ` Robert A Duff
1996-07-23  0:00   ` Robert Dewar
1996-07-24  0:00     ` Peter Hermann
1996-07-26  0:00   ` Stephen J Bevan
1996-07-26  0:00     ` Robert A Duff
replies disabled

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