Fork me on GitHub
#hoplon
<
2020-03-22
>
phronmophobic21:03:16

@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!

jjttjj23:03:46

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?

jjttjj23:03:03

It was actaully discussed about a week ago a little but

jjttjj23:03:08

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.

jjttjj23:03:22

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

phronmophobic21:03:26

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)))