Hi Daniel, Daniel Llorens skribis: > Compare > > (define f (lambda (a) a)) > (call-with-values (lambda () (values 3 3)) f) > > vs > > (call-with-values (lambda () (values 3 3)) (lambda (a) a)) > > The first one fails with > > :1:0: In procedure f: > :1:0: Wrong number of arguments to # > > The second one gives 3. > > This is Guile 2.0.7.112-f5ea5. > > The behavior of the first case makes (compose f g) fail when f takes less args tan g produces. That is unfortunate but I think the former is correct. R5RS doesn’t say anything about the expected behavior when the producer returns a number of values incompatible with what the consumer accepts. R6RS says (Section 5.8): If the number of return values passed to a continuation created by a call to call-with-values is not accepted by its consumer that was passed in that call, then an exception is raised. and Section 11.5: Consumer must be a procedure and should accept as many values as producer returns. R7RS draft #6 uses equivalent wording (I think): Calls its producer argument with no values and a continuation that, when passed some values, calls the consumer procedure with those values as arguments. This patch fixes peval to not inline (call-with-values (lambda () (values vals ...)) (lambda (args ...) ...)) when the length of ‘vals’ differs from that of ‘args’. However, it’s not very elegant, IMO. Andy? Ludo’.