dep.lisp (%dep-value): Force the dep before registering a dependents.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 30 Jun 2018 20:35:15 +0000 (21:35 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 30 Jun 2018 21:52:04 +0000 (22:52 +0100)
Otherwise we'll add the dependent to the list, and then `propagate-to-
dependents' will clear the list, forgetting about us.

dep.lisp

index c437538..3a1520f 100644 (file)
--- a/dep.lisp
+++ b/dep.lisp
 
 (defun %dep-value (dep)
   "Do the difficult work of retrieving the current value of a DEP."
+  (force-dep-value dep)
   (when *evaluating-dep*
     (pushnew (dep-weak-pointer *evaluating-dep*) (dep-dependents dep))
-    (pushnew dep (dep-dependencies *evaluating-dep*)))
-  (force-dep-value dep))
+    (pushnew dep (dep-dependencies *evaluating-dep*))))
 
 (export 'dep-value)
 (declaim (inline dep-value))