[r6rs-discuss] Promises and Multiple Values

Alan Watson alan at alan-watson.org
Mon Jul 23 17:27:04 EDT 2007


Eli,

Thanks for the pointer to SRFI-45. I like your simpler version, although 
it does still contains a closure. For posterity, here is a cleaned-up 
and tested version:

(define make-promise
   (lambda (x)
     (lambda ()
       (if (procedure? x)
           (let ((r (call-with-values x list)))
             (if (procedure? x)
                 (set! x r))))
       (apply values x))))

All of this is probably moot, though, as I suspect the R5RS 
compatibility library is intended to be bug-compatible with the R5RS.

Regards,

Alan



More information about the r6rs-discuss mailing list