comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: aliases/function return values
Date: 7 Sep 90 20:42:27 GMT	[thread overview]
Message-ID: <2095@sparko.gwu.edu> (raw)
In-Reply-To: EACHUS.90Sep7150018@aries.linus.mitre.org

In article <EACHUS.90Sep7150018@aries.linus.mitre.org> eachus@linus.mitre.org (Robert I. Eachus) writes:
>
>     I'll bring this up informally at the URG adn ARG meetings next
>week, but it looks like a confirmation...the return statement returns
>the value of an expression, evaluated before the return.
>
Let's talk about abstraction vs. implementation here. Does this mean that
a value that happens to be large - say a large object of an unconstrained
array type - MUST be copied twice, i.e. once to return it to the caller and
again to store it in its final resting place? Or can an implementer store it
in heap space, for example, returning its address (or a dope vector only) to
the caller? Since some implementers build all unconstrained array types 
this way, by allocating only a dope vector and acquiring object space
dynamically, it would seem that returning function values in the same way
makes sense, right? Then the "value" of the expression is the dope vector
which points to the actual data in the heap, instead of the data itself.

Since the LRM generally leaves storage management issues to the implementer,
especially for arrays, there seems to be no violation here. Am I right?
---------------------------------------------------------------------------
Prof. Michael Feldman
Department of Electrical Engineering and Computer Science
The George Washington University
Washington, DC 20052
202-994-5253
mfeldman@seas.gwu.edu
---------------------------------------------------------------------------

  reply	other threads:[~1990-09-07 20:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-08-28 15:14 aliases/function return values Jerry Callen
1990-08-29 15:12 ` davidr
1990-09-07 19:00   ` Robert I. Eachus
1990-09-07 20:42     ` Michael Feldman [this message]
1990-08-31  0:47 ` Charles H. Sampson
  -- strict thread matches above, loose matches on Subject: below --
1990-08-30 13:29 "Norman H. Cohen"
replies disabled

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