Fork me on GitHub
#hoplon
<
2017-07-14
>
thedavidmeister01:07:34

@flyboarder ok, that's interesting

thedavidmeister01:07:13

i have doubts about the second and third options because i don't think they are generalised enough to be comfortable that i won't just find a new bug next year

thedavidmeister01:07:59

option 3 i'm not sure even works now as for-tpl doesn't add/remove dom elements every time it does something

thedavidmeister01:07:22

could you give an example of how it would look to use the first option?

thedavidmeister01:07:29

that would help me understand how it works 🙂

flyboarder01:07:47

@thedavidmeister :multi-cell [:value cell1 cell2 cell3] last cell value is returned

flyboarder01:07:22

We can wrap this in a custom value attribute so the syntax is hidden

thedavidmeister01:07:31

yeah, so you're doing something along the lines of what @dm3 was saying

thedavidmeister01:07:48

as in, introducing an explicit behaviour

thedavidmeister01:07:27

which would be like, if currently instead of :value 1 :value (j/cell= ...) :value #(...)

thedavidmeister01:07:05

:set/value 1 :cell/value (j/cell= ...) :handler/value #( ... )

thedavidmeister01:07:51

i personally would prefer to keep doing things the way they've been done so far and push the explicit/implicit discussion to a followup ticket

thedavidmeister01:07:03

there's no reason we couldn't have an explicit and implicit style running in parallel for a while

thedavidmeister01:07:27

but realistically we should get input from @alandipert and @micha on this one as we're just going to start going in circles on this pretty soon 😛

thedavidmeister01:07:44

@flyboarder i do see the value of things being explicit, at least optionally. as i said the other night, the implicit on!/do! split confused me a lot when i was first learning about it

flyboarder05:07:10

@thedavidmeister I think I fixed it….. ok so I was thinking you are totally right that we should be able to dispatch based on multiple cells, but then I thought that a formula can already do that, i.e. a formula can return a sequence of values from other cells. So the solution must reside within the attribute itself, then I realized a custom :value attribute can just act like and since it should only contain one value, it can do the lisp thing and returning the end of the list.

thedavidmeister08:07:49

@flyboarder yeah that's true, you can tweak do! so that you can put the list inside the cell rather than have a list of cells

thedavidmeister08:07:37

i think there's pros and cons to having the list inside/outside

thedavidmeister08:07:17

i wouldn't mind either 🙂

dm312:07:20

@alandipert - spent some time on the Clj implementation already in javelin.core-clj (https://github.com/dm3/javelin/tree/macros-split-clj). Split macros into a separate ns and made most of the tests pass (all the other ones annotated with TODO). The good thing is - Java impl kind of works. The bad thing - I run into very strange issues when compiling to Javascript 🙂 Also tried to make it work under self-hosted Clojurescript (with the help of net.cgrand/macrovich) but it still remains a mystery to me how that is supposed to function. It feels like I’m almost there as I haven’t touched the Cljs implementation, just shuffled things around.

dm312:07:55

self-host actually loading the macros now and working properly without macros.

dm312:07:11

but the macros are broken both on normal cljs and self-host

dm313:07:30

ok, so the problem is due to there being two versions of hoist - one for the Clojure and the other for Clojurescript/Self-host

dm313:07:11

haven’t figured out how to load one when compiling Clojure and the other when compiling JVM/Self-host clojurescript

dm314:07:56

self-host working!

dm314:07:00

~/projects/dm3/javelin  (macros-split-clj)
175 > planck -c src/:macrovich-0.2.0.jar
Planck 2.4.0
ClojureScript 1.9.542

cljs.user=> (require '[javelin.core :as j])
nil
cljs.user=> (require-macros '[javelin.macros :as m])
WARNING: Use of undeclared Var javelin.macros$macros/bind-syms at line 212 /Users/dm3/projects/dm3/javelin/src/javelin/macros.cljc
nil
cljs.user=> (m/defc a 1)
#'cljs.user/a
cljs.user=> (m/defc= b (* a 2))
#'cljs.user/b
cljs.user=> (m/defc= effect (println a "* 2 = " b))
1 * 2 =  2
#'cljs.user/effect
cljs.user=> (reset! a 5)
5 * 2 =  10
5

dm314:07:34

the warning is a bug in analyzer

flyboarder15:07:38

@dm3 I started on porting hoplon to self-hosted then I realized it was mostly javelin that needed the ports, glad to see you got it working!!

dm315:07:51

I’ll play around a bit more to see if I can preserve the old ns layout

dm315:07:05

and also fix the JVM Clojurescript…

dm319:07:25

@alandipert did you have any specific idea behind making the fields of the Clojure Cell refs (instead of plain fields)? Or was it mainly to simplify the implementation?

dm319:07:38

I mean in Plumbata

alandipert19:07:17

yeah, making swap! thread safe

alandipert19:07:31

could have used fields and synchronized probably too though