[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug fix

On Sat, 12 Jun 2004, Matthias Radestock wrote:

(define (force promise)
   (let ((content (unbox (unbox promise))))
     (case (car content)
       ((eager) (cdr content))
       ((lazy)  (let* ((promise* ((cdr content)))
                       (content  (unbox (unbox promise))))

Shouldn't that last line use promise*? If so, how come your tests pass?

No. It is correct as it stands. The evaluation of ((cdr content)) in the previous line may update the content of the original promise passed to *force* in case of reentrancy. This is exact what happens in reentrancy test 3 contributed by John Shutt.