Fork me on GitHub
#hoplon
<
2017-07-13
>
thedavidmeister03:07:49

@alandipert what was that thing you wrote where you could query vectors?

ejemba14:07:22

is there a hoplon way to do http/rest request or this is just clojurescript ?

dm317:07:49

@ejemba no standard Hoplon way for that, I’m afraid. There’s Castra, but it’s RPC

dm317:07:11

Can anyone please explain what the js-arguments is used for in here: https://github.com/hoplon/javelin/blob/master/src/javelin/core.cljs#L193?

ejemba17:07:54

@dm3 so the prefered way of working with hoplon is with castra

dm317:07:19

no, it’s just something that already works

flyboarder19:07:59

@thedavidmeister so I have a few proposed solutions that I am working on, the first is to move your fix to a new attribute :multi-cell which works like and returning the last value, it takes a sequence containing an attribute and cells. The attribute is bound to each cell. I’m calling this the n(1) binding solution. My second proposed solution is to inform elements about their -tpl index. This could enable a tpl-cell which updates whenever the element index changes. The third option is to always call do! whenever an element is added to the dom.

flyboarder19:07:16

@alandipert also I am receiving weird messages from javelin java.lang.String cannot be cast to java.lang.Throwable at line 27, column 1 in file app/index.cljs the line contains cell? which it cannot find because I was missing the namespace however this was really hard to spot.

alandipert19:07:59

@ejemba js-arguments is a function for referring to the JS arguments keyword in a function… which refers to an array-like thing containing all arguments that were passed

dm319:07:55

@alandipert figured it out - missed that it’s inside another fn

dm319:07:25

was porting that ns to clj

alandipert19:07:14

@flyboarder maybe you could make an issue w/ one or both proposals?

alandipert19:07:56

then i can look at it later and bug micha to do the same 😄

dm320:07:11

@alandipert I see there’s the Clojure Javelin issue open: https://github.com/hoplon/javelin/issues/25 with some moderate activity

dm320:07:49

there’s also a javelin.core-clj in a working state, as far as I can see

dm321:07:29

haven’t seen you cljc branch and did pretty much the same thing, only used mutable variables instead of refs

dm321:07:10

although my propagate is 10x slower than the one in javelin.core-clj so that’s not great

dm321:07:55

and I agree that the code doesn’t get any nicer…

alandipert21:07:28

based on my recent experimentation, i don’t think the api in general is a great port to clj

dm321:07:18

what do you think are the bad points?

alandipert21:07:36

in cljs you can use formulas casually for side effects, but in clj i think more rigor is required

alandipert21:07:02

so i think you want something that runs in the same order a formula would, but can’t have dependencies

alandipert21:07:51

i think the watch API could be enhanced to be this thing

alandipert21:07:04

esp. if the watch function is run immediately, the way do-watch does it

alandipert21:07:48

i started to make a new clj version a few months ago but it’s on my other computer

alandipert21:07:55

and then i switched to using R lol

dm321:07:58

do you mean a case where a formula does a side effect and is a source for another formula?

dm321:07:52

hm, I don’t immediately see it as a big problem. You can probably shoot yourself in the foot a few times with that though

alandipert21:07:10

yeah, it’s really not a big problem

dm321:07:19

and what about threading? I was thinking a single-thread-only graph would make sense

alandipert21:07:27

yeah i agree there

alandipert21:07:37

that’s another thing about side-efffect-only-formulas (“spouts”?)

alandipert21:07:45

is that they could run in other threads potentially

alandipert21:07:12

since they don’t have dependencies, they could actually block in a transaction and the transaction would still go

dm321:07:10

add-watch=

alandipert21:07:12

altho, a user could just make formulas or watches that put things to do in a queue

dm321:07:32

pretty much

dm321:07:53

either you give the add-watch a function which then executes on your thread pool

dm321:07:03

or you manage the queue yourself

dm321:07:37

yeah, I’ll try using your javelin.core-clj

alandipert21:07:02

i’ll push what i had a few months ago

alandipert21:07:09

iirc it was mostly working and was cleaner than core-clj

alandipert21:07:29

my thinkpad is under the couch somewhere, i just need to retrieve it

dm321:07:51

sure, that would be great

alandipert21:07:26

i remember it had bugs. but i don't remember what they were 🙁