This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-09
Channels
- # aws (4)
- # bangalore-clj (1)
- # beginners (94)
- # boot (19)
- # cider (42)
- # cljs-dev (21)
- # cljsrn (4)
- # clojure (142)
- # clojure-austin (10)
- # clojure-greece (25)
- # clojure-italy (14)
- # clojure-russia (14)
- # clojure-serbia (13)
- # clojure-sg (6)
- # clojure-spec (74)
- # clojure-uk (69)
- # clojurescript (236)
- # consulting (1)
- # cursive (26)
- # data-science (6)
- # datascript (2)
- # datomic (31)
- # editors (5)
- # emacs (24)
- # funcool (5)
- # hoplon (8)
- # jobs-rus (1)
- # luminus (12)
- # lumo (17)
- # off-topic (90)
- # om (45)
- # onyx (5)
- # pedestal (2)
- # powderkeg (12)
- # protorepl (2)
- # re-frame (30)
- # remote-jobs (2)
- # ring-swagger (17)
- # rum (46)
- # slack-help (1)
- # test-check (2)
- # yada (62)
I think there is an issue with case
:
(macroexpand '(case (side-effecting-fn x)
:a 0
1))
=>
(let*
[G__1142928 (if (cljs.core/keyword? (side-effecting-fn x)) (.-fqn (side-effecting-fn x)) nil)]
(case* G__1142928 [["a"]] [0] 1))
And an improvement with regards to switching on multiple keywords:
(macroexpand '(case x
("a" "b") very-very-big-expr
1))
=> (let* [G__1145986 x] (case* G__1145986 [["a" "b"]] [very-very-big-expr] 1))
(macroexpand '(case x
(:a :b) very-very-big-expr
1))
=>
(let*
[G__1145992 (if (cljs.core/keyword? x) (.-fqn x) nil)]
(case* G__1145992 [["a"] ["b"]] [very-very-big-expr very-very-big-expr] 1))
Note how with string tests it'll properly generate an efficient (switch x case "a": case "b": ...)
but with n keywords it'll generate the entire match body n-times.
inspired me to go through some old tickets today - @mfikes finally applied your multiline REPL thing for ClojureScript ๐
does someone have a query to find all tickets with patches? I should know how to do this but I donโt
Ahh, that ancient one? Sweet, Iโll give it a try. Also thanks for re-baselining CLJS-1518 ๐