comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: question about functions
Date: 2000/01/20
Date: 2000-01-20T19:10:17+00:00	[thread overview]
Message-ID: <un1q01s1n.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 867e3p$8ph$1@news.mgn.net

"Pascal LEJEUNE" <pascal.lejeune@matra-transport.fr> writes:

> 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;

You can't find the address of C from within f, in Ada, C, or any other
moderatly high level language. Only assembler lets you do that, as far
as I know.

If you could, what would you do with it? Maybe there is another way to
get the same effect.

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.

I'd still like to know what you are going to do with it.

-- Stephe




  reply	other threads:[~2000-01-20  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-20  0:00 question about functions Pascal LEJEUNE
2000-01-20  0:00 ` Stephen Leake [this message]
2000-01-22  0:00   ` Matthew Heaney
2000-01-24  0:00     ` Mats Weber
2000-01-24  0:00     ` Stephen Leake
2000-01-25  0:00       ` Matthew Heaney
2000-01-27  0:00         ` Stephen Leake
2000-01-22  0:00   ` Andy
2000-01-22  0:00     ` Matthew Heaney
2000-01-24  0:00     ` Stephen Leake
2000-01-20  0:00 ` Tucker Taft
2000-01-20  0:00 ` David Starner
2000-01-20  0:00 ` Hyman Rosen
  -- strict thread matches above, loose matches on Subject: below --
2000-01-21  0:00 Pascal LEJEUNE
2000-01-21  0:00 ` tmoran
2000-01-21  0:00   ` Samuel T. Harris
2000-01-21  0:00     ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox