Fork me on GitHub
#hoplon
<
2016-03-03
>
upgradingdave14:03:13

Hey everyone, good morning from us east coast.

upgradingdave14:03:22

Would anyone be interested in a version of a castra client that uses goog closure machinery instead of jquery?

alandipert14:03:49

sounds interesting, what's the advantage?

upgradingdave14:03:04

I’ve hacked together a version that I’ve been using successfully in pet project for a few weeks. It’s using goog Promise and goog ajax instead of the jquery

upgradingdave14:03:53

I really like the concept of castra, but I didn’t wasn’t using jquery. It was mostly just a challenge for myself to get it working with the goog closure that comes prepackaged with cljs

upgradingdave14:03:03

If anyone else wanted the ability to use castra without jquery, it might be useful.

upgradingdave14:03:37

I’m using it for my own stuff, but if anyone is interested, just wanted to share, I could put the (very hacky) code somewhere. It would take some work to get it so that you could switch between using jquery or google closure

alandipert14:03:20

seems like it could be useful to people, would you like to publish it under the hoplon group?

alandipert14:03:34

interested parties might be likelier to find it that way

upgradingdave14:03:52

ok, cool, sounds good, will do!

alandipert14:03:58

what is your github username? i can add you to the group and then you can create repositories

upgradingdave14:03:29

oh oops, I thought you meant the discourse hosting site, hehe, my bad

upgradingdave14:03:40

I went ahead and created a thread about it here:

alandipert14:03:10

oh cool, that works too

levitanong16:03:52

I'm very interested in goog closure library. I've been waiting for this for a long time. Thanks, @upgradingdave !

levitanong16:03:11

By the way, @alandipert and @micha, have you taken a look at my if-tpl PR? I've been using it on a project and it's surviving the weird stuff I'm throwing at it, so I'm reasonably confident.

alandipert16:03:24

@levitanong: just looked at it now, looks good to me

alandipert16:03:42

i'll be working with micha later today, i'll bug him to take a look at it

levitanong16:03:53

:D thanks, man!

alandipert16:03:05

for switch-tpl

alandipert16:03:14

could that not be implemented in terms of if-tpl? as a macro atop it

alandipert16:03:16

e.g. (switch-tpl t :a foo :b bar) == (if-tpl (cell= t :a) foo (if-tpl (cell= t :b) bar)

levitanong17:03:35

@alandipert: That’s true, but I am worried about the number of watches that would be active at that time. Given the number of switch-tpls that could exist at a time, and the number of clauses each one had, I figured it’d be prudent to implement it from scratch.

levitanong17:03:45

Do you think the performance won’t be an issue?

alandipert18:03:41

it's not until it is simple_smile

alandipert18:03:57

i think in the vast majority of cases it will probably not be an issue

alandipert18:03:08

in any case it might be better to delay the effort until we identify a concret problem

levitanong18:03:44

I was actually modeling this after clojure.core’s cond macro, which would short itself after a clause returned a non-nil. I quickly realized this couldn’t work so simply in hoplon because a value had to be watched—I would have to watch the results of every single one of the clauses, which would mean shorting is impossible. Now that you point out that it’s unlikely to be an issue, perhaps I should redirect my efforts towards implementing a cond-tpl (this would be perfect used with if-tpl), and then later making a switch-tpl that would be a macro on top of cond-tpl.

levitanong18:03:22

What do you think?

levitanong18:03:02

Anyway, it's 2:45 am here and I should turn in. :) let's discuss another time!

numberq20:03:49

@alandipert: FYI, your advice helped a ton with getting my client and server to talk to each other. Everything seems to be working exactly how we want it to. Thanks! parrot

alandipert20:03:05

great! no prob

flyboarder23:03:39

does someone have an example of merging state in a custom element? what I am trying to do is merge some default state with class attribute state but I get No protocol method ICollection.-conj defined for type javelin.core/Cell