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,e5eb8ca5dcea2827 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Ada OO Mechanism Date: 1999/06/14 Message-ID: #1/1 X-Deja-AN: 489520008 Sender: bobduff@world.std.com (Robert A Duff) References: <7i05aq$rgl$1@news.orbitworld.net> <7i17gj$1u1k@news2.newsguy.com> <7icgkg$k4q$1@nnrp1.deja.com> <3749E9EC.2842436A@aasaa.ofe.org> <7id2eo$fag@drn.newsguy.com> <3749FF7D.F17CE16A@aasaa.ofe.org> <374AC676.F7AE0772@lmco.com> <7ieuja$5v9@news1.newsguy.com> <7ifd6l$bmf@sjx-ixn1.ix.netcom.com> <1999Jun8.175959.1@eisner> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1999-06-14T00:00:00+00:00 List-Id: Hyman Rosen writes: > kilgallen@eisner.decus.org (Larry Kilgallen) writes: > > At a more basic level, storing a variable length structure on the stack > > requires that the machine code alter the amount of stack consumed on > > one call from the next. Many other languages do not have programmer- > > visible constructs that do such a run-time determination, so perhaps > > that is what makes the concept seem strange. > > They also don't have functions which return variable-length objects. > Where does the function return value live between the time the > function returns and the time that space is allocated for the variable > on the stack, using the size information in the return value? One model is to just leave it on the stack. The function return then jumps back to where it came from, but does *not* chop back the stack. At the call site, the caller then copies the function result to wherever it belongs. Or, if the call site is another return statement, it just leaves it where it is, and lets the caller's caller deal with it. - Bob -- Change robert to bob to get my real email address. Sorry.