Marc,
in _std.scm you have the following code implementing force:
(define-prim (##force obj) (if (##promise? obj) (let ((result (##promise-result obj))) (if (##eq? result obj) (let* ((r ((##promise-thunk obj))) (result2 (##promise-result obj))) (if (##eq? result2 obj) (begin (##promise-result-set! obj r) (##promise-thunk-set! obj #f) r) result2)))) ;; XXX -- value is unspecified when (not (##eq? result obj)) obj))
I find it very strange that the first if eq test of the result to the promise is lacking the else part; that's where I marked with XXX. Shouldn't the code return result in this case? What am I missing here?
-- vyzo