This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-14
Channels
- # aleph (16)
- # bangalore-clj (4)
- # beginners (19)
- # boot (27)
- # cider (81)
- # clara (2)
- # cljs-dev (343)
- # cljsrn (97)
- # clojure (224)
- # clojure-hk (1)
- # clojure-italy (25)
- # clojure-russia (5)
- # clojure-serbia (2)
- # clojure-spec (7)
- # clojure-uk (27)
- # clojurescript (97)
- # cursive (8)
- # datomic (48)
- # docker (1)
- # emacs (15)
- # hoplon (39)
- # jobs (4)
- # lumo (13)
- # off-topic (2)
- # om (66)
- # onyx (7)
- # parinfer (5)
- # pedestal (2)
- # play-clj (10)
- # protorepl (2)
- # quil (1)
- # re-frame (38)
- # reagent (33)
- # spacemacs (1)
- # specter (4)
- # sql (19)
- # test-check (31)
- # unrepl (4)
- # untangled (3)
@flyboarder ok, that's interesting
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
option 3 i'm not sure even works now as for-tpl doesn't add/remove dom elements every time it does something
could you give an example of how it would look to use the first option?
that would help me understand how it works 🙂
@thedavidmeister :multi-cell [:value cell1 cell2 cell3]
last cell value is returned
We can wrap this in a custom value attribute so the syntax is hidden
yeah, so you're doing something along the lines of what @dm3 was saying
as in, introducing an explicit behaviour
which would be like, if currently instead of :value 1
:value (j/cell= ...)
:value #(...)
we had
:set/value 1
:cell/value (j/cell= ...)
:handler/value #( ... )
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
there's no reason we couldn't have an explicit and implicit style running in parallel for a while
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 😛
@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
@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.
@thedavidmeister ^ example
@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
i think there's pros and cons to having the list inside/outside
i wouldn't mind either 🙂
@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.
ok, so the problem is due to there being two versions of hoist
- one for the Clojure and the other for Clojurescript/Self-host
haven’t figured out how to load one when compiling Clojure and the other when compiling JVM/Self-host clojurescript
~/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
@dm3 woot!!!
nice 🙂
@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!!
@thedavidmeister another lib for your CSS: https://github.com/Jarzka/stylefy
@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?
yeah, making swap! thread safe
could have used fields and synchronized probably too though