eliminate last cljs compiler warning

This commit is contained in:
Nathan Marz 2016-06-02 01:15:35 -04:00
parent c1d9dff75e
commit 8a0ba0b3b0
2 changed files with 10 additions and 7 deletions

View file

@ -2,6 +2,7 @@
* More efficient inline caching for Clojure version, now inline caching is always within 5% of manually precompiled code * More efficient inline caching for Clojure version, now inline caching is always within 5% of manually precompiled code
* Significant performance improvement for ALL transform on maps for Clojure version (25% on simple benchmarks) * Significant performance improvement for ALL transform on maps for Clojure version (25% on simple benchmarks)
* Significant performance improvements for FIRST/LAST for vectors * Significant performance improvements for FIRST/LAST for vectors
* Eliminated compiler warnings when used in ClojureScript
## 0.11.0 ## 0.11.0
* New `path` macro does intelligent inline caching of the provided path. The path is factored into a static portion and into params which may change on each usage of the path (e.g. local parameters). The static part is factored and compiled on the first run-through, and then re-used for all subsequent invocations. As an example, `[ALL (keypath k)]` is factored into `[ALL keypath]`, which is compiled and cached, and `[k]`, which is provided on each execution. If it is not possible to precompile the path (e.g. [ALL some-local-variable]), nothing is cached and the path will be compiled on each run-through. * New `path` macro does intelligent inline caching of the provided path. The path is factored into a static portion and into params which may change on each usage of the path (e.g. local parameters). The static part is factored and compiled on the first run-through, and then re-used for all subsequent invocations. As an example, `[ALL (keypath k)]` is factored into `[ALL keypath]`, which is compiled and cached, and `[k]`, which is provided on each execution. If it is not possible to precompile the path (e.g. [ALL some-local-variable]), nothing is cached and the path will be compiled on each run-through.

View file

@ -43,16 +43,18 @@
(defn throw-illegal [& args] (defn throw-illegal [& args]
(throw (js/Error. (apply str args)))) (throw (js/Error. (apply str args))))
;; these macroexpand functions are for path macro in bootstrap cljs ;; these macroexpand functions are for path macro in bootstrap cljs environment
;; environment
#+cljs #+cljs
(defn macroexpand' (defn macroexpand'
[form] [form]
(binding [^:cljs.analyzer/no-resolve cljs.js/*eval-fn* (let [orig-eval-fn ^:cljs.analyzer/no-resolve cljs.js/*eval-fn*]
^:cljs.analyzer/no-resolve cljs.js/js-eval] (try
(^:cljs.analyzer/no-resolve cljs.js/eval (^:cljs.analyzer/no-resolve cljs.js/empty-state) (set! ^:cljs.analyzer/no-resolve cljs.js/*eval-fn* ^:cljs.analyzer/no-resolve cljs.js/js-eval)
`(macroexpand (quote ~form)) (^:cljs.analyzer/no-resolve cljs.js/eval (^:cljs.analyzer/no-resolve cljs.js/empty-state)
identity))) `(macroexpand (quote ~form))
identity)
(finally
(set! ^:cljs.analyzer/no-resolve cljs.js/*eval-fn* orig-eval-fn)))))
#+cljs #+cljs
(defn do-macroexpand-all (defn do-macroexpand-all