comp.lang.ada
 help / color / mirror / Atom feed
From: Jeff Carter <spam.carter.not@spam.innocon.com>
To: "=:-) Vincent" <vb@bruker.fr>
Subject: Re: "out" or "access"
Date: 1998/10/21
Date: 1998-10-21T00:00:00+00:00	[thread overview]
Message-ID: <362DF0D3.BC101364@spam.innocon.com> (raw)
In-Reply-To: 908956499.754394@dedale.pandemonium.fr

=:-) Vincent wrote:
> 
> What's the best way ?
> 
> package B is
>     ...
>     The_Procedure ( The_Parameter: out Integer );
>     -- or The_Procedure ( The_Parameter: access Integer );
>     ...
> end B;
> ...
> package body A is
>     ...
>     g_Toto: Integer; -- or aliased Integer
>     ...
>     procedure The_Other_Procedure is
>     begin
>         ...
>         B.The_Procedure ( g_Toto );
>         -- or  B.The_Procedure( g_Toto'Access );
>         ...
>     end;
>     ...
> end A;

There's no comparison. An access parameter is closer to an "in out"
parameter than an "out" parameter. If an "out" parameter will do, do not
use an access parameter if you can avoid it. If an "in out" parameter
will do, still don't use an access parameter if you can avoid it. Access
parameters exist primarily to interfaces with subprograms from other
languages.

-- 
Jeff Carter  PGP:1024/440FBE21
E-mail: carter commercial-at innocon period com
"Monsieur Arthur King, who has the brain of a duck, you know."
Monty Python & the Holy Grail




  reply	other threads:[~1998-10-21  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-21  0:00 "out" or "access" =:-) Vincent
1998-10-21  0:00 ` Jeff Carter [this message]
1998-10-21  0:00   ` Pat Rogers
1998-10-21  0:00     ` Martin C. Carlisle
1998-10-22  0:00       ` Pat Rogers
1998-10-22  0:00     ` Robert A Duff
1998-10-21  0:00 ` Tucker Taft
1998-10-22  0:00   ` Pascal Obry
1998-10-29  0:00     ` Robert A Duff
1998-10-29  0:00       ` Matthew Heaney
1998-10-29  0:00         ` Robert A Duff
1998-10-30  0:00           ` dennison
1998-10-30  0:00             ` Matthew Heaney
1998-10-30  0:00               ` Robert A Duff
1998-10-31  0:00                 ` dewar
1998-10-31  0:00                   ` Matthew Heaney
1998-10-31  0:00                 ` Matthew Heaney
1998-11-01  0:00                   ` Robert A Duff
1998-11-01  0:00                     ` Matthew Heaney
1998-11-01  0:00                       ` Robert A Duff
1998-11-02  0:00                         ` Matthew Heaney
1998-11-03  0:00                           ` Simon Wright
1998-11-16  0:00                             ` Matthew Heaney
1998-10-21  0:00 ` dennison
replies disabled

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