Closed gtnoble closed 1 year ago
When using unwind-protect and with-handler and continuing overflow and underflow conditions, forms are not evaluated in proper order. The tests below should pass.
unwind-protect
with-handler
(import "test") (defun mult-underflow () (* 1E-200 1E-200)) (defun mult-overflow () (* *positive-infinity*)) (defun add-overflow () (+ *positive-infinity*)) (defun test-underflow-overflow (underflowing) ($assert-ordered-operations '(first second third fourth) (unwind-protect (with-handler (lambda (condition) (record-operation 'second) (continue-condition condition)) (record-operation 'first) (funcall underflowing) (record-operation 'third)) (record-operation 'fourth)))) (test-underflow-overflow #'mult-underflow) (test-underflow-overflow #'mult-overflow) (test-underflow-overflow #'add-overflow)
Fixed.
Thanks again! This helps me a lot with my project.
When using
unwind-protect
andwith-handler
and continuing overflow and underflow conditions, forms are not evaluated in proper order. The tests below should pass.