comp.lang.ada
 help / color / mirror / Atom feed
From: pascal.obry@der.edfgdf.fr (Pascal Obry)
Subject: Re: Is 'out' different from 'in out' (Was: Uninitialized "out" parameters)
Date: 1996/07/24
Date: 1996-07-24T00:00:00+00:00	[thread overview]
Message-ID: <4t55jl$e4o@cf01> (raw)
In-Reply-To: gauthier-2307961037570001@164.81.60.62

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2145 bytes --]


gauthier@unilim.fr (Michel Gauthier) wrote:

>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'.

This is certainly true for the designer of the procedure. But 'out'
and 'in out' parameter provide one usefull information for the
caller of the procedure/function.

There is two parts in the programming job. You are sometimes designer
(you are fulfilling a demand - providing a functionality) and
sometimes client (using what has already be done). In our case 'out'
and 'in out' are differents for clients :

	'out'
	you don't have to initialize the parameter. this is done
	inside the procedure/function.

	'in out'
	you have to initialize the paramter because the value passed to
	the procedure/function will be used.


For example :

    package P is

	type T is limited private;

	procedure Init1 (Item : in out T);

	procedure Init2 (Item :    out T);

    end P;


I really prefer Init2 and I found Init1 misleading (how can I pass
an initialized parameter ?). So I don't found the rule 'avoid out
parameter' a good one.

Pascal.

--|------------------------------------------------------------
--| Pascal Obry                               Team-Ada Member |
--|                                                           |
--| EDF-DER-IPN-SID- Ing�nierie des Syst�mes d'Informations   |
--|                                                           |
--| Bureau G1-010           e-mail: pascal.obry@der.edfgdf.fr |
--| 1 Av G�n�ral de Gaulle  voice : +33-1-47.65.50.91         |
--| 92141 Clamart CEDEX     fax   : +33-1-47.65.50.07         |
--| FRANCE                                                    |
--|------------------------------------------------------------
--|
--|   http://ourworld.compuserve.com/homepages/pascal_obry
--|
--|   "The best way to travel is by means of imagination"





  parent reply	other threads:[~1996-07-24  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 ` 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     ` Adam Beneschan
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                 ` Robert A Duff
1996-07-25  0:00                   ` Richard A. O'Keefe
1996-07-24  0:00                 ` Fergus Henderson
1996-07-19  0:00   ` Pascal Obry
1996-07-19  0:00     ` Peter Hermann
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           ` 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-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               ` Robert A Duff
1996-07-24  0:00               ` Fergus Henderson
1996-07-24  0:00               ` Fergus Henderson
1996-07-25  0:00               ` Richard A. O'Keefe
1996-07-25  0:00                 ` Robert A Duff
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   ` Tucker Taft
1996-07-22  0:00   ` Robert A Duff
1996-07-22  0:00     ` Robert Dewar
1996-07-23  0:00 ` Michel Gauthier
1996-07-23  0:00   ` Robert Dewar
1996-07-24  0:00   ` Pascal Obry [this message]
1996-07-25  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-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