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: Tucker Taft Subject: Re: question about functions Date: 2000/01/20 Message-ID: <38875FBF.8F18F5BD@averstar.com>#1/1 X-Deja-AN: 575381963 Content-Transfer-Encoding: 7bit References: <867e3p$8ph$1@news.mgn.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@inmet2.burl.averstar.com X-Trace: inmet2.burl.averstar.com 948395972 4207 141.199.8.164 (20 Jan 2000 19:19:32 GMT) Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 NNTP-Posting-Date: 20 Jan 2000 19:19:32 GMT Newsgroups: comp.lang.ada Date: 2000-01-20T19:19:32+00:00 List-Id: Pascal LEJEUNE wrote: > > Hello, > > I would like to know if there is a "clean" (i.e. not compiler dependant) > solution to this problem : > > - i have a function, for example : f(A, B : in T) return T > - how can i find the return address in f ? > > I explain : > if C := f(A, B); > > how can i know, in f, C's addres ? > function f(A, B : in T) return T is > ... > begin > ... > address of the result of f ? > ... > end f; > > Thank you for your help There is no way to know the address of the object being assigned the result of the function call. I don't know of any language that would provide this. Note that the function result might not be stored into a variable at all. You need to change your function into a procedure with an OUT parameter, then use 'Address on the OUT parameter, if knowing the address is essential. > Pascal LEJEUNE -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA