hoplon

phronmophobic 2020-03-20T20:54:43.262900Z

@smith.adriane has joined the channel

phronmophobic 2020-03-20T22:17:30.263600Z

is hoplon’s javelin supported in clj on the jvm?

flyboarder 2020-03-20T22:17:54.264100Z

there is a clj version but it’s kinda experimental

phronmophobic 2020-03-20T22:18:34.264700Z

that’s perfect. I’m currently experimenting! is there specific branch I should work with?

phronmophobic 2020-03-20T22:20:50.265100Z

i noticed that. I was trying to work through the readme with > (ns membrane-javelin.core > (:require [javelin.core-clj :refer [cell cell= defc defc=]]) > (:gen-class)) > > > (defc a 42) ;; cell containing the number 42 > (defc b ’(+ 1 2)) ;; cell containing the list (+ 1 2) > (defc c (+ 1 2)) ;; cell containing the number 3 > (defc d {:x @a}) ;; cell containing the map {:x 42} > > (defc= e {:x a}) ;; cell with formula {:x a}, updated when a changes > (defc= f (+ a 1)) ;; cell with formula (+ a 1), updated when a changes > (defc= g (+ a ~(inc @a))) ;; cell with formula (+ a 43), updated when a changes > (defc= h [e f g]) ;; cell with formula [e f g], updated when e, f, or g change

phronmophobic 2020-03-20T22:21:34.265300Z

I’m getting class clojure.lang.Atom cannot be cast to class java.lang.Number at (defc= f (+ a 1))

phronmophobic 2020-03-20T22:23:48.265500Z

presumably, defc= isn’t noticing that a is a previously defined cell? not sure if the macro is supposed to take care of that for you

flyboarder 2020-03-20T22:24:06.265700Z

i dont think any of the macros work in clj

👍 1
phronmophobic 2020-03-21T00:09:42.266Z

what’s the ideal behavior for cell= to determine which symbols should be treated as referring to cells? seems like it’s just ignoring locals, clojure core symbols, and special symbols?

phronmophobic 2020-03-21T00:10:02.266200Z

there’s a number of ways that could produce unexpected results

phronmophobic 2020-03-21T00:19:34.266400Z

I was thinking of doing something that tries to resolve the symbol in the current namespace to check if it’s a cell and if it’s a local variable from a let, then having it do the check at runtime

2020-03-21T01:38:22.266700Z

@smith.adriane https://github.com/hoplon/javelin/pull/40 I've got this PR (not mine) working on the JVM

2020-03-21T01:38:35.266900Z

and there's a pretty good description there

phronmophobic 2020-03-21T01:39:34.267400Z

awesome! i’ll check it out

2020-03-21T01:39:58.267600Z

wait that's the wrong link

2020-03-21T01:40:37.267900Z

Fixed it, off by one error 🙂