[r6rs-discuss] Promises and Multiple Values
alan at alan-watson.org
Fri Jul 20 12:32:25 EDT 2007
The text associated with delay and force in the R5.97RS (and the R5RS,
for that matter) talks about "a value" rather than "values".
Nevertheless, I see no reason why force should not deliver multiple
values to its continuation. In the context of the example implementation
given in R5.97RS, I would suggest the following definition of make-promise:
(let ((results #f))
(let ((x (call-with-values proc list)))
(if (not results)
(set! results x))
With this, the following:
(call-with-values (lambda () (force (delay (values 0 1 2)))) list)
gives (0 1 2) rather than (0).
More information about the r6rs-discuss