Fork me on GitHub
#clojurescript
<
2017-11-23
>
leira02:11:49

Is there such rule as ":refer :all" cannot be used in cljs? I kept getting "clojure.lang.ExceptionInfo: Don't know how to create ISeq from: clojure.lang.Keyword" with it.

leira02:11:10

if I change line 3 to "[game-of-life.game :refer [neighbors]]))", it passed

thheller02:11:33

yes, :refer :all is not allowed

leira02:11:53

@thheller thx~ Is there any document talking about his?

thheller02:11:25

not sure, also not sure why it doesn’t complain properly. there should be a proper error.

leira02:11:52

yeah some explicit error, better with a URL to the document

mfikes04:11:48

@leira Not sure if this helps, but in Clojure, (doc require) indicates:

:refer takes a list of symbols to refer from the namespace or the :all
    keyword to bring in all public vars.
where the same in ClojureScript indicates:
:refer takes a list of symbols to refer from the namespace.

mfikes04:11:13

@leira As an aside, your cljs.test libspec could be simplified to look exactly like it would in Clojure:

(ns game-of-life.game-test
  (:require [clojure.test :refer [deftest testing is]]
            [game-of-life.game :refer [sym-a sym-b]]))
(This is detailed in (doc ns) under "Auto-aliasing clojure namespaces" and "Implicit macro loading".)

tomaas15:11:34

has anyone use react-virtualized-select?

tomaas15:11:47

that lib isn't in cljsjs site

qqq23:11:22

clj has things like float-array, double-array, and type hints to ensure realy blazingly fast numerical math is there a similar set of tools/techniques for javascript/cljs ?

mfikes23:11:45

@qqq What can happen is that the JavaScript engine can "see" that you are doing math on, say integers instead of doubles, and optimize a tight loop for that, deopting if a double happens to slip through. So, in some sense, instead of type hints, we have sophisticated numeric optimizations that occur at runtime (for free).

mfikes23:11:16

I suppose this statement ^ is really independent of ClojureScript

qqq23:11:09

@mfikes: what about boxing / unboxing ? is it possible in js to say "I want an array of doubles, and it's all raw doubles, without object wrappers" ?

mfikes23:11:32

Hmm. Isn't that what you get with (to-array [1 2 3])?