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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!samsung!uunet!seas.gwu.edu!mfeldman From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: aliases/function return values Message-ID: <2095@sparko.gwu.edu> Date: 7 Sep 90 20:42:27 GMT References: <12594@encore.Encore.COM> <20600058@inmet> Reply-To: mfeldman@seas.gwu.edu () Organization: The George Washington University, Washington D.C. List-Id: In article 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 ---------------------------------------------------------------------------