comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Question on in/out parameters
Date: Sun, 1 May 2022 09:50:03 +0200	[thread overview]
Message-ID: <t4le38$t8j$1@dont-email.me> (raw)
In-Reply-To: <fb8e503f-70a3-44a3-867e-132191f25762n@googlegroups.com>

Le 30/04/2022 à 13:30, reinert a écrit :
> So there is no difference between "in", "in out" and "out" for
> Vectors except that the compiler protests if I try to change an "in
> parameter" in the actual subroutine/function?
> 
"in" is read only, so there is a difference.

The difference between "in out" and "out" is not for the compiler (in 
this case), but for the reader: if you declare a parameter as "out", you 
promise that you won't use the previous value of the parameter, and 
therefore that the procedure is OK if you call it with an uninitialized 
variable (i.e. that the procedure is appropriate to initialize an 
otherwise uninitialized variable).

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52
https://www.adalog.fr

  reply	other threads:[~2022-05-01  7:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-30  8:57 Question on in/out parameters reinert
2022-04-30  9:38 ` Jeffrey R.Carter
2022-04-30 11:30   ` reinert
2022-05-01  7:50     ` J-P. Rosen [this message]
2022-05-02 21:35 ` 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