comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: in-out and out parameters
Date: Fri, 27 Feb 2004 17:54:44 -0600
Date: 2004-02-27T17:54:44-06:00	[thread overview]
Message-ID: <103vm769jj96pfa@corp.supernews.com> (raw)
In-Reply-To: 1077805821.190885@master.nyc.kbcfp.com

"Hyman Rosen" <hyrosen@mail.com> wrote in message
news:1077805821.190885@master.nyc.kbcfp.com...
> Evangelista Sami wrote:
> > I thought that, as I and J were passed by references
>
> In Ada, out parameters may be passed using copy-in/copy-out
> rather than by reference in certain circumstances.

Which are all of them in this case (elementary types are *always* passed by
copy-in/copy-out). Ada has types that must always be passed by reference as
well. And there are some types where the compiler is allowed to choose - but
the compiler is likely to make the same choice for all parameter passing
modes (for instance, if the objects are large).

Thus, the choice between by-reference and by-copy depends mostly on the type
of the item passed; the parameter passing mode has little or no effect on
how items are passed.

              Randy.






      reply	other threads:[~2004-02-27 23:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-26 14:00 in-out and out parameters Evangelista Sami
2004-02-26 14:18 ` Frank J. Lhota
2004-02-26 14:23 ` Jacob Sparre Andersen
2004-02-26 14:29 ` Jean-Pierre Rosen
2004-02-26 14:30 ` Hyman Rosen
2004-02-27 23:54   ` Randy Brukardt [this message]
replies disabled

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