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

Re: [Scheme-reports] Technical question

On Thu, 26 May 2011 11:34:48 -0400, Eli Barzilay <eli@x> wrote:

> This is a question for WG1 (collectively):
> According to R5RS, is this code:
>   (call-with-values
>     (lambda ()
>       (call-with-current-continuation (lambda (k) (k 1 2 3))))
>     (lambda (x y z) 'ok))
> allowed to throw an error, or to return anything other than 'ok ?

I strongly believe that the above code must return the symbol 'ok'. The  
wording of the R5RS is not, IMO, ambiguous here. The continuation k  
receives its values and is required to then pass these to the three  
argument lambda [fuzzy wording, I know], and since the correct number of  
arguments are indeed passed, I fail to find any room for unspecified  
behavior. I believe the only unspecified behavior that R5RS deals with in  
this case is whether a continuation expecting X number of values receives  
Y number of values, where X≠Y.

You ask for the collective WG1 voice on this, and unfortunately, I do not  
think that we have a mechanism for this. However, we can file a ticket  
concerning this issue and decide on it. Since even Chibi returns the  
symbol ok for the above now (after Alex's fix), I don't think the above  
code is particularly contentious anymore.

If someone disagrees, please, let's hear it.

	Aaron W. Hsu

Programming is just another word for the lost art of thinking.

Scheme-reports mailing list