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: gauthier@unilim.fr (Michel Gauthier) Subject: Is 'out' different from 'in out' (Was: Uninitialized "out" parameters) Date: 1996/07/22 Message-ID: #1/1 X-Deja-AN: 169427506 references: <31EEACDA.64880EEB@sage.inel.gov> organization: Universite de Limoges newsgroups: comp.lang.ada Date: 1996-07-22T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) wrote: >> In article , >> Michel Gauthier wrote: >> >This problem is harmless here, but can lead to counterintuitive results when >> >the type implies initialisation (records, controlled types, access types). >> >Intuitively, the actual parameter should be Finalize'd prior to entering the >> >subprogram, and re-Initialize'd as part of elaborating the declarative part >> >of the subprogram ___Is it the behaviour that results from LRM ?___ >> >> No. Controlled types are always passed by reference. That is, the >> formal is a view of the actual (not a copy of it). So no finalization >> takes place on parameter passing. Reference vs. copy passing does not seem to be relevant here. My intuitive view, and I guess the easier to teach, is that 'out' parameters involve initialization at the beginning of the subprogram. I remember a discussion during the 9X process about 'out', and a conclusion that there was no longer a difference between 'out' and 'in out'. Of course, I do not assert that all 83 compilers did behave the intuitive way. So, I repost the question in another form : ___is there a difference between 'out' and 'in out' parameters ?___ Consequent questions are : ___is an 'out' pointer reset to null when entering the subprogram ?___ ___is an 'out' controlled object finalised and reinitialised when entering the subprogram ?___ ___is an 'out' record with initial values reinitialised when entering the subprogram ?___ Finally, ___an AI discussion might be envisaged___. Don't you think so ? ---------- ---------- ---------- ---------- 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 ---------- ---------- ---------- ----------