comp.lang.ada
 help / color / mirror / Atom feed
From: "Marius Amado Alves" <amado.alves@netcabo.pt>
To: <comp.lang.ada@ada-france.org>
Subject: Re: "out" parameters
Date: Sat, 29 May 2004 00:45:10 +0100
Date: 2004-05-29T00:45:10+01:00	[thread overview]
Message-ID: <mailman.15.1085787921.391.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: e26e273.0405281514.1df36f22@posting.google.com

> If I have a record that contains 2 fields, I initialize the 1st field,
> I then pass the record as an 'out' parameter to a subprogram.  The
> subprogram assigns a value to the 2nd field and returns.
>
> If the record has neither elementary nor access type in it, then the
> compiler may have the flexibility to decide how it wants to pass the
> record.
>
> The question is, what value should I expect for the 1st field in the
> record when the subprogram returns?

This is defined by the language, it's not compiler-dependent.

If you mean "in out" (and not just "out"), you get out whatever you passed
in in any component and the subprogram did not touch.

If you really mean (just) "out", well, you cannot expect to get out anything
valid that the subprogram did not touch, can you? After all, you're not
passing anything "in".

(Well, actually you may be kind of passing something, e.g. bounds. But never
field values.)




  reply	other threads:[~2004-05-28 23:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20 23:37 "out" parameters Jo
2004-05-20 23:53 ` Ludovic Brenta
2004-05-21  0:33   ` Georg Bauhaus
2004-05-21 19:17   ` Keith Thompson
2004-05-21 22:25     ` Vinzent 'Gadget' Hoefler
2004-05-22  8:20     ` Martin Krischik
2004-05-25 20:34     ` Robert I. Eachus
2004-05-21  1:09 ` Jeffrey Carter
2004-05-21  9:28 ` Martin Krischik
2004-05-28 23:14   ` Jo
2004-05-28 23:45     ` Marius Amado Alves [this message]
2004-05-29  1:45     ` Jeffrey Carter
2004-05-29  7:15     ` Martin Krischik
2004-06-04 21:59 ` Nick Roberts
2004-06-18  0:58   ` Jo
replies disabled

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