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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,803df5f3f60558d5 X-Google-Attributes: gid103376,public From: stt@henning.camb.inmet.com (Tucker Taft) Subject: Re: Is 'out' different from 'in out' (Was: Uninitialized "out" parameters) Date: 1996/07/22 Message-ID: #1/1 X-Deja-AN: 170054034 sender: news@inmet.camb.inmet.com (USENET news) x-nntp-posting-host: henning.camb.inmet.com references: organization: Intermetrics, Inc. newsgroups: comp.lang.ada Date: 1996-07-22T00:00:00+00:00 List-Id: Michel Gauthier (gauthier@unilim.fr) wrote: : So, I repost the question in another form : : ___is there a difference between 'out' and 'in out' parameters ?___ At what level? At the implementation level, for a parameter of an elementary type, there is a big difference. No value is copied in (unless it is of an access type). No constraint check is performed on the way in (even if it is of an access type). For a parameter of a composite type, constraint checks all happen on the way in in any case (whether, IN, IN OUT, or OUT). If the parameter is passed by copy, and has no fields requiring default initialization, then no copy-in is performed. If the composite parameter has fields requiring default initialization, or is passed by reference, then there is no difference at the implementation level. : Consequent questions are : : ___is an 'out' pointer reset to null when entering the subprogram ?___ No; its incoming value is preserved. : ___is an 'out' controlled object finalised and reinitialised when entering : the subprogram ?___ No; controlled types are always passed by reference. : ___is an 'out' record with initial values reinitialised when entering the : subprogram ?___ No, but its incoming value is preserved, if you mean "has fields requiring default initialization" when you say "record with initial values." : Finally, ___an AI discussion might be envisaged___. Don't you think so ? AI meaning "artificial intelligence"? ;-) Or AI meaning Ada Interpretation? If you mean the latter, I believe RM95 is pretty clear on all of the above points. Do you have a particularly paragraph that you believe is ambiguous? : Michel Gauthier / Laboratoire d'informatique : 123 avenue Albert Thomas / F-87060 Limoges : telephone +33 () 55457335 [or ~ 7232] : fax +33 () 55457315 [or ~7201] -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Cambridge, MA USA