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.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,95758615693d80e7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-21 09:37:38 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison Subject: Re: Parameters in Sub Message-ID: <31Kq7.9078$p77.31214@www.newsranger.com> X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Fri, 21 Sep 2001 12:37:19 EDT Organization: http://www.newsranger.com Date: Fri, 21 Sep 2001 16:37:19 GMT Xref: archiver1.google.com comp.lang.ada:13236 Date: 2001-09-21T16:37:19+00:00 List-Id: In article <9ofn8h$m0v$1@reader1.fr.uu.net>, Marc says... > >Hello, >I will want to know: modes OUT and IN OUT, in a procedure, show all the 2 >clearly a passage of parameters by " address " (of the variable). I have a >doubt about what one call the passage " by reference " >I associated it IN OUT has this type of passage. Is this well that. Then >the passage by " value " designe it IN, the passage by " address " designe >the OUT??? Thank you for your answers. This is a bit hard to decipher, but it looks like you are asking when/if "OUT" and "IN OUT" use reference passing, and when they use value. The quick answer is "it depends". A slightly more complete answer is that there are some situations where the language specifies reference passing, but in all other situations it is up to the compiler. In those cases you can trust that the compiler will do what is most efficient (eg: reference whenever the value would be too big to fit in a register), but you *must* not make your code depend on the mode by taking addresses of parameters or assuming two parameters of the same type are different objects. For a complete answer, I suggest you either read the relevant LRM sections or get a good Ada book that covers this subject. There are some situations where it is useful to know which is done. But if you are an Ada beginner, the best rule is to just assume that the compiler knows what it is doing, and do not write your code in such a way that proper operation depends on one method or the other. Whatever you do, do *not* look to pass around addresses with the misguided assumption that it will be quicker. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com