[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple values proposal

> Date:	Thu, 18 Mar 1993 09:53:55 -0800
> From:	Morry Katz <katz@quilty.stanford.edu>
> I hate to throw a monkey wrench into the whole process, but the above
> does not match my recollection of what was approved at the R5RS
> meeting.  In the expression 
> (call-with-values
>  (call-with-current-continuation
>   (lambda (k)
>    (k (values 1 2 3))))
>  (lambda (a b c)
>   . . .))
> k better be a continuation that accepts 3 values or things are going
> to be very broken.

There are two bugs in this code.  The first is that the first argument to
CALL-WITH-VALUES is supposed to yield a thunk.  The second is that the call to
VALUES is in argument position and so certainly returns the wrong number of
values for its continuation.  Here is what I suspect Morry meant to write:

	(call-with-values (lambda ()
			      (lambda (k)
			        (k 1 2 3))))
	  (lambda (a b c)
	    . . .))

And now, this looks to me like code that's entirely legal under the description
that was posted.