Commit 9c043926 by Eugene Zhemchugov Committed by Liam M. Healy

Make callbacks reentrant

Rebind callback dynamic variables upon entry into the callback function.
With this fix callbacks can be called recursively.
parent 24eecac1
......@@ -369,4 +369,7 @@
'integration-test-f454
(grid:copy-to (vector 0.0d0 1.0d0 (sqrt 2.0d0) 3.0d0))
0.0d0 1.0d-3 1000)
(integration-QAWc 'integration-test-f459 -1.0d0 5.0d0 0.0d0 0.0d0 1.0d-3 1000))
(integration-QAWc 'integration-test-f459 -1.0d0 5.0d0 0.0d0 0.0d0 1.0d-3 1000)
(integration-QAG (lambda (x)
(integration-QAG (lambda (y) (* (sin x) y)) 0d0 1d0 :gauss41))
0d0 pi :gauss41))
......@@ -235,4 +235,6 @@
;; CL specials to do the same job.
(declare ,@(when (member :slug args) `((ignore ,slug)))
(special ,dynamic-variable))
(funcall ,dynamic-variable ,@(mapcar 'grid:st-symbol (remove :slug args))))))
(let ((,dynamic-variable ,dynamic-variable))
(declare (special ,dynamic-variable))
(funcall ,dynamic-variable ,@(mapcar 'grid:st-symbol (remove :slug args)))))))
......@@ -232,5 +232,12 @@
(LIST -0.08994400695837003d0 1.18529017636488d-6)
(MULTIPLE-VALUE-LIST
(INTEGRATION-QAWC 'INTEGRATION-TEST-F459 -1.0d0 5.0d0
0.0d0 0.0d0 0.001d0 1000)))))
0.0d0 0.0d0 0.001d0 1000))))
(LISP-UNIT:ASSERT-NUMERICAL-EQUAL (LIST 1.0d0 1.1102230246251565d-14)
(MULTIPLE-VALUE-LIST
(INTEGRATION-QAG
(LAMBDA (X)
(INTEGRATION-QAG
(LAMBDA (Y) (* (SIN X) Y)) 0.0d0 1.0d0
:GAUSS41))
0.0d0 PI :GAUSS41))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment