Fork me on GitHub
#cljs-dev
<
2017-05-09
>
rauh09:05:32

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))

rauh09:05:12

Only for keyword tests.

rauh09:05:27

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))

rauh09:05:32

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.

favila12:05:02

@rauh I think cljs-2029 is a dup

dnolen12:05:53

@rauh ok, patch welcome

rauh13:05:57

@favila You're right: . I need to improve my search-fu.

dnolen13:05:07

inspired me to go through some old tickets today - @mfikes finally applied your multiline REPL thing for ClojureScript ๐Ÿ™‚

dnolen13:05:33

does someone have a query to find all tickets with patches? I should know how to do this but I donโ€™t

mfikes13:05:47

Ahh, that ancient one? Sweet, Iโ€™ll give it a try. Also thanks for re-baselining CLJS-1518 ๐Ÿ™‚

dnolen13:05:12

@mfikes it just applied ๐Ÿ™‚

dnolen13:05:18

shows how little REPL ns has changed

mfikes13:05:38

It is perfect, no change needed ๐Ÿ™‚

rauh14:05:39

@dnolen Attached a patch for 2030

bronsa14:05:41

@dnolen Project = CLJS AND Patch != null AND status NOT IN (closed, resolved) in JQL

dnolen14:05:00

@bronsa sweet, thanks and saved ๐Ÿ™‚

slipset15:05:08

I've looked through quite a bit of the backlog looking for easy fixes, and I seem to remember seeing quite a few issues referring to each other's and also to closed issues.

slipset15:05:29

If it would be of interest, I could probably compile some sort of dependency graph/these issues seem related kind of thing.