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: Stephen Leake Subject: Re: question about functions Date: 2000/01/24 Message-ID: #1/1 X-Deja-AN: 577031284 References: <867e3p$8ph$1@news.mgn.net> X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov X-Trace: skates.gsfc.nasa.gov 948740605 11514 128.183.220.71 (24 Jan 2000 19:03:25 GMT) Organization: NASA Goddard Space Flight Center NNTP-Posting-Date: 24 Jan 2000 19:03:25 GMT Newsgroups: comp.lang.ada Date: 2000-01-24T19:03:25+00:00 List-Id: "Matthew Heaney" writes: > In article , Stephen Leake > 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. > > C'Address is only defined if T is a by-reference type. > > See RM95 13.3 (16). 13.3 (16) is implementation advice; it suggests that X'Address be useful in certain situations, including by-reference types. X'Address is _defined_ in 13.3 (11), which says nothing about where it may be useful. Hmm, I'm not clear if a subprogram parameter is an "object" here, but I believe it is. In any case, I have often successfully used 'Address on subprogram parameters that are not of a by-reference type, with both ObjectAda and GNAT, so at least some compilers go beyond the implementation advice. -- Stephe