[plt-scheme] passing multiple "values" between functions

From: Anthony Cowley (acowley at seas.upenn.edu)
Date: Mon Apr 6 13:37:05 EDT 2009

On Mon, Apr 6, 2009 at 7:49 AM, Matthias Felleisen <matthias at ccs.neu.edu> wrote:
> On Apr 6, 2009, at 4:24 AM, Jakub Piotr Cłapa wrote:
>> On 4/6/09 9:23 AM, Martin DeMello wrote:
>>> that there is no "values" object that you can pass around till you're
>>> ready to unpack it. Do values offer any advantage over using lists and
>>> let-match?
>> AFAIK returning multiple values does not require allocation (no consing)
>> and destructuring (the values go straight to the bindings).
> See Dybvig's analysis and experiments concerning this 'conjecture.' Turns
> out that for an 'optimizing' compiler (such as Chez) the major difference
> concern error reporting. (Think (let* ((x f returns (cons 1 2))) (a (car x))
> (d (cdr x))) ...) can be optimized reasonably w/o allocation.)
> -- Matthias

There was an interesting discussion of this on comp.lang.scheme a
while ago which yielded this set of benchmarks:


Posted on the users mailing list.