Fork me on GitHub
#clojurescript
<
2016-01-03
>
crocket03:01:43

@christopherbui: You could use piggieback.

christopherbui03:01:54

Too late for that

underplank04:01:23

@gdulus: check for a circular dep. If you use lein cljsbuild once you might get a stack overflow. I just got a similar error.

danthedev07:01:58

Trying to set up garden, for writing css, but lein garden once and lein garden auto are dropping without doing anything

danthedev07:01:16

I've got the lein-garden plugin installed

danthedev07:01:02

Anyone know whether they're just failing silently?

decoursin07:01:20

Why, in CLJS, are the functions in defprotocol prepended with a dash? https://crossclj.info/ns/org.clojure/clojurescript/1.7.189/cljs.core.cljs.html#_ISeq

decoursin07:01:38

Here's an example: (defprotocol ISeq (-first [coll]))

decoursin07:01:51

why is it -first instead of first?

crocket07:01:48

@decoursin: You should understand defprotocol first.

decoursin07:01:08

Well, I understand it in Clojure.

crocket07:01:43

-first is probably not to be used directly. Dash was probably prepended to make it explicit that it shouldn't be used directly.

decoursin07:01:34

That makes sense. Thank you

selfsame07:01:58

is there a cljs workaround for (binding [*ns* (find-ns 'foo.baz)] )?

selfsame08:01:41

@ul (do (ns foo.bar) (def x 5)) defs x in the current ns

crocket08:01:04

Calling ns in places other than the top of a source file is not advisable.

selfsame08:01:16

just trying to get a repl to eval blocks in the file's ns

ul08:01:27

in-ns ?

ul08:01:46

should switch to another ns

selfsame08:01:17

sync.matrix=> (do (in-ns 'fp.flow) (def frog 8))
WARNING: Use of undeclared Var sync.matrix/in-ns at line 1 <cljs repl>

artemyarulin10:01:02

Hi, not sure if’s an issue but (map hash [0.9 0.7]), clojure returns (-216006655 1501560832), while clojurescript returns [0 0]. This expression always return true (that how I found it):

(= (hash {:a (rand) :b (rand)})
   (hash {:a (rand) :b (rand)}))

crocket11:01:22

Javascript is not known for treating hash as a first class citizen. But, java's Object has a hash method. JVM ecosystem has incentives to implement hash well.

artemyarulin11:01:07

Well, indeed but it works just fine for numbers (cause hash is equal to that). The problem is Math.floor call which loose the data. Even (hash (toString o)) would fix this issue, although it’s slow and not a complete solution

magomimmo12:01:49

https://github.com/magomimmo/modern-cljs has been fully ported to the latest 2.5.5 stable release of boot build tool

dnolen15:01:44

@artemyarulin: right, the question is how to detect floating point efficiently. Conversion to strings is out of the question.

dnolen15:01:55

@artemyarulin: this conversation is better for #C07UQ678E

dnolen15:01:35

@selfsame there’s no good way to do that since there aren’t ns objects in ClojureScript

curtosis17:01:31

I swear I saw somewhere a guide for packaging a clojure (JVM) backend as part of an electron clojurescript app, but I can't find it anywhere now. Anyone know of something like that?

curtosis17:01:02

(or is it simpler to just package the whole thing up as an executable uberjar...)

denik22:01:19

@juhoteperi literallycanvas is a cool drawing app with react as its only dependency. Would it need an externs file? https://github.com/literallycanvas/literallycanvas