From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,803df5f3f60558d5 X-Google-Attributes: gid103376,public From: pascal.obry@der.edfgdf.fr (Pascal Obry) Subject: Re: Is 'out' different from 'in out' (Was: Uninitialized "out" parameters) Date: 1996/07/24 Message-ID: <4t55jl$e4o@cf01>#1/1 X-Deja-AN: 170047224 references: <31EEACDA.64880EEB@sage.inel.gov> organization: EDF - DER newsgroups: comp.lang.ada Date: 1996-07-24T00:00:00+00:00 List-Id: 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"