Related articles |
---|
[26 earlier articles] |
Re: Multiple return values jens.hansson@mailbox.swipnet.se (1997-05-04) |
Re: Multiple return values jamesl@netcom.com (1997-05-08) |
Re: Multiple return values hbaker@netcom.com (1997-05-08) |
Re: Multiple return values mark@omnifest.uwm.edu (1997-05-13) |
Re: Multiple return values bear@sonic.net (Ray Dillinger) (1997-05-13) |
Re: Multiple return values jan@fsnif.neuroinformatik.ruhr-uni-bochum.de (Jan Vorbrueggen) (1997-05-14) |
Re: Multiple return values hbaker@netcom.com (1997-05-14) |
Re: Multiple return values markt@harlequin.co.uk (Mark Tillotson) (1997-05-25) |
Re: Multiple return values hbaker@netcom.com (1997-05-25) |
Re: Multiple return values jmccarty@sun1307.spd.dsccc.com (1997-05-30) |
From: | hbaker@netcom.com (Henry Baker) |
Newsgroups: | comp.compilers,comp.lang.misc |
Date: | 14 May 1997 23:57:20 -0400 |
Organization: | nil |
References: | 97-04-091 97-04-112 97-04-135 97-05-045 97-05-094 97-05-172 |
Keywords: | design |
Ray Dillinger <bear@sonic.net> wrote:
> As far as I've gotten in thinking about it is to try to detect whether
> the calling code wants (will actually use) one return value or more
> (most of the time I figure it'll only want one) and compile separate
> versions of the function; one which returns a single value (in
> registers or on the stack) and one which returns more than a single
> value (likewise).
One approach is to have the caller tell the callee how many and/or which
return values it actually cares about. The caller knows this, but the
callee doesn't. This can be utilized for overloading (a la Ada), or for
run-time testing.
A good example of this is a bignum quotient+remainder. If you tell the
routine in advance whether you want the quotient, the remainder, or both,
then the subroutine doesn't have to waste time generating the unwanted
results.
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.