This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-23
Channels
- # aws (2)
- # beginners (57)
- # boot (63)
- # cider (7)
- # clara (1)
- # cljs-dev (1)
- # cljsrn (5)
- # clojure (68)
- # clojure-brasil (1)
- # clojure-dusseldorf (2)
- # clojure-greece (10)
- # clojure-italy (29)
- # clojure-russia (1)
- # clojure-spec (9)
- # clojure-uk (66)
- # clojurescript (16)
- # cursive (18)
- # datomic (19)
- # docker (3)
- # figwheel (2)
- # fulcro (61)
- # instaparse (7)
- # jobs (1)
- # luminus (5)
- # lumo (47)
- # mount (6)
- # off-topic (13)
- # onyx (39)
- # planck (4)
- # portkey (2)
- # re-frame (28)
- # ring (6)
- # ring-swagger (30)
- # rum (3)
- # shadow-cljs (142)
- # spacemacs (5)
- # sql (2)
- # unrepl (61)
- # untangled (2)
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.
not sure, also not sure why it doesn’t complain properly. there should be a proper error.
@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.
@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".)http://blog.fikesfarm.com/posts/2016-03-01-clojurescript-macro-sugar.html and http://blog.fikesfarm.com/posts/2016-07-03-clojurescript-clojure-namespace-aliasing.html might also be helpful
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 ?
@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).