comp.lang.ada
 help / color / mirror / Atom feed
From: Lutz Donnerhacke <lutz@iks-jena.de>
Subject: Re: Limited_Controlled types as 'out' arguments
Date: Thu, 31 Jul 2003 07:43:05 +0000 (UTC)
Date: 2003-07-31T07:43:05+00:00	[thread overview]
Message-ID: <slrnbihi3p.2j7.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: vig72n2ike5icc@corp.supernews.com

* Randy Brukardt wrote:
> "Lutz Donnerhacke" <lutz@iks-jena.de> wrote in message
>> which is clearly wrong in the same way.
> 
> Of course. "in out" and "out" parameters for tagged types (and most other
> types as well) are equivalent. Consider the lack of an "in" to be a comment
> to the caller, not to the author of the subprogram.

I thought a call "xxx(my)" to "procedure xxx (a : out Test)" is very similar
to "my := xxx", if a "function xxx return Test" exists.

This idea is wrong.

> not be initialized (esp. if the type isn't controlled), but the object as a
> whole is initialized. If it wasn't, the tag wouldn't be set, which would
> make even membership operations impossible.

Ack for discriminants, tags, etc.
Nack for private data.

So the consequence is: If you pass a controlled type as an 'out' paramenter
in the type defining library unit, provide sufficient initialization for all
private data, otherwise you can't distiguish uninitalized garbage from real
data.

>> So the only result of this can be: Do not provide 'out' Parameters to
>> controlled types in the same library unit.
>
> No, just realize that "out" is the same as "in out" as far as the
> implementation of a routine is concerned. But it still can provide useful
> information to the caller.

I'm going to see this, but I'm still confused.



  reply	other threads:[~2003-07-31  7:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-30 11:31 Limited_Controlled types as 'out' arguments Lutz Donnerhacke
2003-07-30 12:22 ` Dmitry A. Kazakov
2003-07-30 12:32   ` Lutz Donnerhacke
2003-07-30 14:24     ` Dmitry A. Kazakov
2003-07-30 14:25       ` Lutz Donnerhacke
2003-07-30 14:48         ` Dmitry A. Kazakov
2003-07-30 15:15           ` Lutz Donnerhacke
2003-07-31 10:26             ` Dmitry A. Kazakov
2003-07-31 10:54               ` Lutz Donnerhacke
2003-07-31 11:50                 ` Dmitry A. Kazakov
2003-07-31 12:19                   ` Lutz Donnerhacke
2003-07-31 13:15                     ` Dmitry A. Kazakov
2003-07-31 17:51                 ` Randy Brukardt
2003-07-30 15:01         ` Vinzent Hoefler
2003-07-30 15:16           ` Lutz Donnerhacke
2003-07-30 15:52         ` Lutz Donnerhacke
2003-07-30 19:30           ` Randy Brukardt
2003-07-31  7:43             ` Lutz Donnerhacke [this message]
2003-07-30 12:31 ` Matthew Heaney
2003-07-30 12:57   ` Lutz Donnerhacke
2003-07-30 13:47     ` Martin Dowie
2003-07-30 17:06     ` Matthew Heaney
2003-07-30 12:37 ` Martin Dowie
2003-07-30 12:59   ` Lutz Donnerhacke
2003-07-30 13:41     ` Martin Dowie
replies disabled

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