manuel-serrano / bigloo

a practical Scheme compiler
http://www-sop.inria.fr/indes/fp/Bigloo
Other
135 stars 19 forks source link

Fix for nested invocations of call-with-values #66

Closed donaldsonjw closed 2 years ago

donaldsonjw commented 3 years ago

To properly handle nested call-with-values invocations where the outer call-with-values generator does not return multiple values via values, we reset the default number of return values to 1 before invoking the outer consumer.

For example, we want

(call-with-values (lambda ()
                   (call-with-values (lambda () (values 1 2 3))
                                     +))
                   list)

to return (6) not (6 2 3)

manuel-serrano commented 2 years ago

Thank you Joseph for this useful fix. All my apologizes for the latency of my reaction.