Clojurians
#cljs-dev
<
2017-06-25
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

anmonteiro03:06:42

anybody else getting some duplicate warnings when running tests with current master?

anmonteiro03:06:16

(for undeclared variables)

anmonteiro04:06:43

other than the above, all tests pass in Lumo downstream

mfikes14:06:12

^ seems like a minor issue because it doesn’t affect non-`:static-fns` (when warnings are normally dealt with)

dnolen15:06:59

let me see if I can fix that

dnolen16:06:42

yes easy to fix

rauh17:06:17

Also, when testing master, don't forget to try the new compiler switch :fn-invoke-direct. It should "just work" without having to modify any code. Has anybody tried it yet?

mfikes18:06:51

Perhaps an :fn-invoke-direct change could be queued up for https://clojurescript.org/reference/compiler-options

rauh18:06:18

Good point! I'll add it once there is a release.

mfikes18:06:24

TL;DR adding it there would cause any cached code to be re-compiled in order to honor the option

dnolen19:06:08

@mfikes good catch applying

mfikes19:06:10

I can’t get :fn-invoke-direct to cause different code to be emitted. I have :repl-verbose true :static-fns true :fn-invoke-direct true in script/noderepljs and, while the :static-fns flag is working, :fn-invoke-direct doesn’t seem to elide call in the JavaScript emitted, for example (defn f [x] (x 1))

rauh19:06:58

@mfikes That's strange, the option really only needs :static-fns to true.

dnolen19:06:40

@mfikes we need to fix this in repl.cljc

dnolen19:06:51

I always forget about that, because this is done with a dyn var

dnolen20:06:07

fixing that now

dnolen20:06:43

also need to do this for self-host

dnolen20:06:46

fixing that now too :slightly_smiling_face:

mfikes20:06:22

Ahh… cool.

mfikes20:06:39

Confirmed for JVM REPL, and added support for it to Planck and confirmed there.

planck --verbose --static-fns --fn-invoke-direct -e '(defn f [x] (x 1))'
yields the desired call elision.