I’m not sure how to make cf-freeze play nicely with with-c-conj .
Let’s say we have a rule like
:derived-vals (cF (with-c-conj []
(if-let [dep (mget me :some-slot)]
(next-derived-val dep)
(cf-freeze))))
The last value in the vector (mget md :derived-vals) will be a vector of all the values
I made an alternative that ignores the cached val
(defmacro freeze-nil []
`(do
(rmap-setf [:optimize ~'_cell] :freeze)
nil))Sorry, a little woozy just now. I tried to give us the option to specify the frozen value:
(defmacro cf-freeze [& [value]]
(let [value-ref (or value '_cache)]
`(do
(rmap-setf [:optimize ~'_cell] :freeze)
~value-ref)))
So (cf-freeze nil) should do what you want, if my wooze is not in the way. 🙂 Let me know if I misunderstood!Or, of course, if that ^^^ is not working!!
Or maybe I never pushed the latest version?
Finally (?) your solution is fine. 🙂