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.9 required=5.0 tests=BAYES_00 autolearn=ham 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 11:46:45 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newspeer.radix.net!uunet!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Parameters in Sub X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3BAB86B9.1A9402FF@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <31Kq7.9078$p77.31214@www.newsranger.com> Mime-Version: 1.0 Date: Fri, 21 Sep 2001 18:28:09 GMT X-Mailer: Mozilla 4.5 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:13242 Date: 2001-09-21T18:28:09+00:00 List-Id: Ted Dennison wrote: > > 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. This is not completely correct (see ARM 6.2). Elementary types (such as integral and real types) are always passed by copy. Tagged types and limited types are always passed by reference, as are composite types with a component that must be passed by reference. Other types do not have their passing mechanisms specified; it is up to the compiler to decide. I think the original poster was attempting to equate parameter modes with parameter passing mechanisms. This is a common mistake for Ada beginners who know languages in which the coder specifies the passing mechanism (such as Pascal). The original poster should become aware that there is no relationship between the parameter mode (in, in out, or out) and the parameter passing mechanism. The parameter mode is a high-level specification of how the parameter is used by the subprogram. -- Jeffrey Carter