@jjttjj, I finally got all setup with jvm version of javelin. it took a while since I’m new to both javelin and boot. thanks for the help!
I was having an issue with unquoted expressions being derefed if they returned refs. I wrote a fix at https://github.com/phronmophobic/javelin/commit/61c6fd784295760e5ed4018c5a8a9325a8add35b , but I’m not sure if those are the desired semantics below are the relevant tests:
;; modified test
(let [a (cell 100)
b (cell 200)
c (cell= (when (odd? b) (reset! ~a (* b 2))))]
(is (= @a 100))
(swap! b inc)
(is (= @a 402)))
;; new test
(let [a (cell 100)
c (cell= ~a)]
(is (identical? @c a))
(swap! a inc)
(is (identical? @c a)))
Have you seen formula-of
of formulet
? (aka fn=
and let=
) where you specify the cells to be deref'd and then can use others as normal in the expression?
It was actaully discussed about a week ago a little but
but I don't think you're supposed to be able to do
(def x (cell 123))
(def y (cell= (reset! ~x 122))
Or at least that has never worked for me in regular javelin.https://clojurians.slack.com/archives/C08BDAPRA/p1584044565197500
https://clojurians.slack.com/archives/C08BDAPRA/p1584058876226900
not sure if this helps. I know I tried to do stuff like that before and it never worked but now I just use the other formula functions in those situations