This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-01
Channels
- # admin-announcements (3)
- # beginners (25)
- # boot (21)
- # cider (39)
- # cljs-dev (86)
- # cljsrn (20)
- # clojars (4)
- # clojure (70)
- # clojure-canada (1)
- # clojure-greece (101)
- # clojure-poland (16)
- # clojure-russia (35)
- # clojure-spec (202)
- # clojure-uk (24)
- # clojurescript (69)
- # cursive (23)
- # datomic (34)
- # devcards (7)
- # dirac (5)
- # editors (3)
- # emacs (6)
- # events (1)
- # hoplon (52)
- # instaparse (1)
- # jobs (4)
- # jvm (2)
- # lein-figwheel (2)
- # leiningen (10)
- # luminus (2)
- # mount (1)
- # off-topic (12)
- # om (55)
- # om-next (8)
- # onyx (19)
- # pedestal (4)
- # planck (1)
- # re-frame (27)
- # reagent (5)
- # remote-jobs (1)
- # spirituality-ethics (14)
- # tmp-json-parsing (6)
- # untangled (121)
- # yada (32)
is there any library to parse ns forms and give me back information about aliases? AFAIK clojure.tools.namespace.parse
does not give me that info. I want to support aliases in Dirac and don’t want to reinvent the wheel
https://github.com/binaryage/dirac/issues/21
https://github.com/thheller/shadow-build/blob/master/src/clj/shadow/cljs/util.clj#L183
thanks a lot, will consider it, but if I had to port it, I would consider simply feeding the source into cljs.analyzer and trying to get its info back
that is cool, but my concern here is maintenance cost, don’t want to replicate what cljs compiler already does and potentially diverge
I will eventually play with clojure.spec
to see if I can make it work to parse the ns form
will look into cljs.analyzer/parse-ns
, thanks, I’m not much familiar with analyzer apis
@darwin: If nothing else, you can perhaps make things easier by first calling desugar-ns-specs
to make the result easier to parse.
(defn desugar [[_ ns & specs]]
`(ns ~ns
~@(ana/desugar-ns-specs specs)))
would put things into a “canonical” formbtw. my usage of prismatic schema validations turned to be quite slow during development, I did one trick which made it usable, I used js/WeakMap to cache all validator results, this helped a lot, I think this could be applied to clojure.spec as well (whenever WeakMap is avail)
Exception in thread "main" java.lang.ClassCastException: sun.nio.cs.UTF_8 cannot be cast to java.lang.String, compiling:(/Users/zilence/code/oss/clojurescript/bin/../bin/cljsc.clj:22:1)
at clojure.lang.Compiler.load(Compiler.java:7239)
at clojure.lang.Compiler.loadFile(Compiler.java:7165)
at clojure.main$load_script.invoke(main.clj:275)
at clojure.main$script_opt.invoke(main.clj:337)
at clojure.main$main.doInvoke(main.clj:421)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at clojure.lang.Var.invoke(Var.java:388)
at clojure.lang.AFn.applyToHelper(AFn.java:160)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassCastException: sun.nio.cs.UTF_8 cannot be cast to java.lang.String
at cljs.closure$set_options.invoke(closure.clj:247)
at cljs.closure$make_options.invoke(closure.clj:288)
at cljs.closure$optimize.doInvoke(closure.clj:1236)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:632)
at cljs.closure$build.invoke(closure.clj:1975)
at cljs.closure$build.invoke(closure.clj:1886)
at user$eval5502.invoke(cljsc.clj:23)
at clojure.lang.Compiler.eval(Compiler.java:6782)
at clojure.lang.Compiler.load(Compiler.java:7227)
... 9 more
@mfikes happy to take subsequent patches that make macro checking work in bootstrapped
@dnolen: Thanks! Actually, since TCHECK-105 hasn’t yet been folded in, bootstrap works fine with the parts of Spec that people can use. CLJS-1656 only really becomes applicable when test.check itself supports bootstrap (Gary Fredericks estimated he’ll get to that within a week or so).
does CLJS 1.9 strictly require Clojure 1.8 or is that not the case? edit: I meant clojure 1.9
I meant 1.9, editing
I’m getting a compilation warning for this line in the analyzer https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer.cljc#L2366
probably boot or some tool requiring the analyzer in cljs. That causes mchk
to bind to _
after the reader conditional is applied. I’ll dig further and provide more information
if someone has time to review http://dev.clojure.org/jira/browse/CLJS-1658
I've been bitten by this for the third time now, each time spending an hour trying to figure out what is going on 😛
yes, the main thing I want to see on that ticket would be an eyeball of the benchmarks across the 3 major engines
;;; satisfies?
[coll (list 1 2 3)], (satisfies? ISeq coll), 1000000 runs, 9 msecs
[coll [1 2 3]], (satisfies? ISeq coll), 1000000 runs, 23 msecs
;;; satisfies?
[coll (list 1 2 3)], (satisfies? ISeq coll), 1000000 runs, 8 msecs
[coll [1 2 3]], (satisfies? ISeq coll), 1000000 runs, 16 msecs
http://dev.clojure.org/jira/browse/CLJS-1658 results in comments