comp.lang.ada
 help / color / mirror / Atom feed
From: gauthier@unilim.fr (Michel Gauthier)
Subject: Re: Is 'out' different from 'in out' (Was: Uninitialized "out" parameters)
Date: 1996/07/23
Date: 1996-07-23T00:00:00+00:00	[thread overview]
Message-ID: <gauthier-2307961037570001@164.81.60.62> (raw)
In-Reply-To: 31EEACDA.64880EEB@sage.inel.gov


Thanks to dewar@cs.nyu.edu (Robert Dewar),
      stt@henning.camb.inmet.com (Tucker Taft) and
      bobduff@world.std.com (Robert A Duff) 
          for their answers to my initial posting :  

>>  [...]  
>>  So, I repost the question in another form :
>>  ___is there a difference between 'out' and 'in out' parameters ?___
>>  [...]

They all confirm what I was not entirely sure to understand correctly.
There is no essential difference between 'out' and 'in out' parameters,
and it is probably worth considering them to be the same thing.

IMHO, it was a mistake of the 9X design. It's too late to repair.

Possible useful style rule : avoid 'out' parameters, since they
are error-prone, and prefer 'in out'.

-----

In article <Duy5JB.3o@world.std.com>, Bob Duff wrote:

>> [...]
>>  
>>  Well, it's not a *compiler* issue -- the RM says it.

Agreed with, but I guess nobody assumes that "LRM says"
always implies "all validated compilers do".
By all the ancient Greeks' gods, it would be great if it were true !
Apologies if no explicit compiler names are given here.
  
>>  [...]
>>
>>  Note that in Ada 83, your intuitive view was not true.  One such case is
>>  when the formal is an unconstrained array.  In that case, the bounds of
>>  the array are passed IN, even if the mode is OUT.  For your intuitive
>>  view to work, Ada would have to have truly dynamic arrays (that is,
>>  arrays that can change size on assignment).  Discriminants are similar
>>  to array bounds.

Another view is that bounds and discriminants are properties of the
_variable_ itself, always of mode 'in', and that the mode is a
property of the contents. Possibly formally dubious, but didactically
useful.

-----

In article <DuyC0H.6Fr.0.-s@inmet.camb.inmet.com>,
stt@henning.camb.inmet.com (Tucker Taft) wrote:

>>  Michel Gauthier (gauthier@unilim.fr) wrote:
>>  [...]  
>>  : ___is an 'out' controlled object finalised and reinitialised when entering
>>  : the subprogram ?___
>>  
>>  No; controlled types are always passed by reference.

Parameter passing has _nothing_ to deal with where the
finalisation takes place, either as a preliminary phase of
calling (strict 'out' behaviour) or as part of the first
later assignment (LRM 'in out'-like behaviour).

Possible interpretation of the debate : my view is at a higher level
(in the programming sense) than Bob's and Tuck's, which yields a
false appearence of disagreeing.

>>  [...]   
>>  : Finally, ___an AI discussion might be envisaged___. Don't you think so ?
>>  
>>  AI meaning "artificial intelligence"? ;-)  Or AI meaning Ada Interpretation?

" Ada Interpretation", of course. But all answers converge to 
no doubt in interpretation. So, I remove the suggestion.

----------          ----------          ----------          ---------- 
Michel Gauthier / Laboratoire d'informatique
123 avenue Albert Thomas / F-87060 Limoges
telephone +33 () 55457335 [or ~ 7232]
fax +33 ()  55457315  [or ~7201]
----------          ----------          ----------          ----------
La grande equation de la fin du siecle : windows-X = Mac-Y
The main end-of-century equation : windows-X = Mac-Y
----------          ----------          ----------          ----------
Si l'an 2000 est pour vous un mysticisme stupide, utilisez la base 9
If you feel year 2000 a stupid mystic craze, use numeration base 9
----------          ----------          ----------          ----------




  parent reply	other threads:[~1996-07-23  0:00 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-18  0:00 Uninitialized "out" parameters Paul Whittington
1996-07-18  0:00 ` Robert Dewar
1996-07-19  0:00   ` Peter Amey
1996-07-20  0:00   ` Fergus Henderson
1996-07-20  0:00     ` Robert Dewar
1996-07-21  0:00       ` Fergus Henderson
1996-07-21  0:00         ` Robert Dewar
1996-07-23  0:00           ` Richard A. O'Keefe
1996-07-23  0:00             ` Robert A Duff
1996-07-24  0:00               ` Richard A. O'Keefe
1996-07-24  0:00                 ` Robert A Duff
1996-07-25  0:00                   ` Richard A. O'Keefe
1996-07-25  0:00                     ` Robert A Duff
1996-07-24  0:00                 ` Theodore E. Dennison
1996-07-25  0:00                 ` Frank Manning
1996-07-25  0:00                   ` Richard A. O'Keefe
1996-07-26  0:00                     ` Frank Manning
1996-07-23  0:00             ` Robert Dewar
1996-07-24  0:00               ` Fergus Henderson
1996-07-24  0:00               ` Fergus Henderson
1996-07-24  0:00               ` Robert A Duff
1996-07-25  0:00               ` Richard A. O'Keefe
1996-07-25  0:00                 ` Robert A Duff
1996-07-23  0:00           ` Fergus Henderson
1996-07-23  0:00             ` Robert A Duff
1996-07-24  0:00               ` Fergus Henderson
1996-07-24  0:00               ` Fergus Henderson
1996-07-18  0:00 ` Adam Beneschan
1996-07-18  0:00   ` Robert Dewar
1996-07-19  0:00   ` Samuel Tardieu
1996-07-19  0:00     ` John Herro
1996-07-19  0:00       ` Tucker Taft
1996-07-23  0:00         ` Peter Hermann
1996-07-23  0:00           ` Robert A Duff
1996-07-19  0:00   ` Dale Stanbrough
1996-07-19  0:00     ` James A. Squire
1996-07-19  0:00       ` Adam Beneschan
1996-07-20  0:00       ` Michael Feldman
1996-07-21  0:00         ` Fergus Henderson
1996-07-21  0:00           ` Michael Feldman
1996-07-21  0:00             ` Robert Dewar
1996-07-22  0:00             ` Fergus Henderson
1996-07-23  0:00               ` Michael Feldman
1996-07-23  0:00                 ` Robert Dewar
1996-07-25  0:00                   ` Fergus Henderson
1996-07-24  0:00                 ` Fergus Henderson
1996-07-24  0:00                 ` Robert A Duff
1996-07-25  0:00                   ` Richard A. O'Keefe
1996-07-19  0:00     ` Adam Beneschan
1996-07-19  0:00   ` Pascal Obry
1996-07-19  0:00     ` Peter Hermann
1996-07-19  0:00 ` Peter Amey
1996-07-19  0:00 ` Michel Gauthier
1996-07-21  0:00   ` Robert A Duff
1996-07-21  0:00 ` Robert A Duff
1996-07-22  0:00 ` Is 'out' different from 'in out' (Was: Uninitialized "out" parameters) Michel Gauthier
1996-07-22  0:00   ` Robert A Duff
1996-07-22  0:00     ` Robert Dewar
1996-07-22  0:00   ` Tucker Taft
1996-07-23  0:00 ` Uninitialized "out" parameters John Herro
1996-07-23  0:00   ` Robert A Duff
1996-07-24  0:00     ` Uninitialized variables, Java example Arra Avakian
1996-07-25  0:00       ` Robert A Duff
1996-07-25  0:00       ` Richard A. O'Keefe
1996-07-25  0:00         ` Robert A Duff
1996-07-23  0:00   ` Uninitialized "out" parameters Robert Dewar
1996-07-24  0:00     ` Peter Hermann
1996-07-26  0:00   ` Stephen J Bevan
1996-07-26  0:00     ` Robert A Duff
1996-07-23  0:00 ` Michel Gauthier [this message]
1996-07-23  0:00   ` Is 'out' different from 'in out' (Was: Uninitialized "out" parameters) Robert Dewar
1996-07-24  0:00   ` Pascal Obry
1996-07-25  0:00   ` Tucker Taft
1996-07-24  0:00 ` Uninitialized variables, Java example Felaco
replies disabled

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