It's as if we do the loop:
for (x=5; ; x--) y += 1/x;
That's no different than demanding a stack trace for:
(define (loop x) (set! y (+ y (/ 1 x)) (loop (- x 1)) (loop 5)
It's as if we do the loop:
And when it throws an exception for dividing by zero, you should want a full "backtrace", with a "frame" for each iteration of the loop.That's no different than demanding a stack trace for: