From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Question about out parameters of unconstrained array type.
Date: Sat, 25 Feb 2012 16:33:08 +0100
Date: 2012-02-25T16:33:08+01:00 [thread overview]
Message-ID: <ovox7uzc45of.1i424y4a6c4v5.dlg@40tude.net> (raw)
In-Reply-To: I8qdndMrnK9zZtXS4p2dnAA@giganews.com
On Sat, 25 Feb 2012 10:19:02 -0500, Peter C. Chapin wrote:
> Consider a simple procedure
>
> procedure P(S : out String) is
> begin
> ...
> end P;
>
> Despite the fact that S behaves as if it is uninitialized my Ada
> compiler (GNAT GPL 2011) allows me to read certain attributes.
Uninitialized /= not constructed
> Is it well defined?
Yes, because the actual of S has all attributes set. Compare it with this:
declare
S : String (1..20); -- S is uninitialized, but constructed
begin
if S'Length > 0 then -- This is OK
> Where does it say so?
I don't know, but there is common sense: Ada's design is sane enough not to
allow existence of indefinite objects.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2012-02-25 15:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-25 15:19 Question about out parameters of unconstrained array type Peter C. Chapin
2012-02-25 15:33 ` Dmitry A. Kazakov [this message]
2012-02-25 18:20 ` Phil Thornley
2012-02-25 20:01 ` Simon Wright
2012-02-25 22:44 ` Phil Thornley
2012-02-27 13:48 ` Mark Lorenzen
2012-02-27 15:32 ` Phil Thornley
2012-02-25 23:37 ` Alexander Senier
2012-02-26 1:16 ` Peter C. Chapin
2012-02-26 9:14 ` Phil Thornley
2012-02-26 12:25 ` Alexander Senier
2012-02-26 13:20 ` Phil Thornley
2012-02-26 14:25 ` Niklas Holsti
2012-02-26 17:32 ` Jeffrey Carter
2012-02-26 15:29 ` Peter C. Chapin
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox