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: Re: Is 'out' different from 'in out' (Was: Uninitialized "out" parameters) Date: 1996/07/23 Message-ID: #1/1 X-Deja-AN: 170446560 references: <31EEACDA.64880EEB@sage.inel.gov> organization: Universite de Limoges newsgroups: comp.lang.ada Date: 1996-07-23T00:00:00+00:00 List-Id: 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 , 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 , 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 ---------- ---------- ---------- ----------