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,9d66743a9fdd96bd X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: question about functions Date: 2000/01/22 Message-ID: #1/1 X-Deja-AN: 576222550 Content-transfer-encoding: 7bit References: <867e3p$8ph$1@news.mgn.net> <3889A56C.61C4@nospam.com.tj> Content-Type: text/plain; charset="US-ASCII" X-ELN-Date: Sat Jan 22 10:58:26 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 948567506 38.26.88.249 (Sat, 22 Jan 2000 10:58:26 PST) Organization: EarthLink Network, Inc. Mime-version: 1.0 NNTP-Posting-Date: Sat, 22 Jan 2000 10:58:26 PST Newsgroups: comp.lang.ada Date: 2000-01-22T00:00:00+00:00 List-Id: In article <3889A56C.61C4@nospam.com.tj> , Andy wrote: >> One alternate approach that is possible in Ada is to pass the result >> as an 'out' parameter : >> >> procedure f (A, B : in T; C : out T); >> >> now you can do C'Address. >> > But this would give the address of the formal parameter which > may not be the address of the actual parameter. Unless T is a > tagged type, isn't the compiler free pass parameters by > reference or value? Certain types are guaranteed to be passed by reference. By-reference types include tagged types and limited types. (Note that a limited type doesn't have to be tagged to be passed by reference.) Scalar types must be passed by value. The language doesn't specify whether composite types (nonlimited records arrays) are passed by reference or by value. If you want to take the address (here, C'Address) of a subprogram parameter, the parameter must be a by-reference type: either tagged or limited. See RM95 13.3 (16). -- Philosophy may be ignored but not escaped; and those who most ignore least escape. David Hawkins