This commit is contained in:
Nathan Marz 2016-06-03 16:25:27 -04:00
parent 91599baf00
commit e1138747d9
3 changed files with 10 additions and 3 deletions

View file

@ -4,8 +4,9 @@
* Significant performance improvements for FIRST/LAST for vectors * Significant performance improvements for FIRST/LAST for vectors
* Eliminated compiler warnings for ClojureScript version * Eliminated compiler warnings for ClojureScript version
* Dropped support for Clojurescript below v1.7.10 * Dropped support for Clojurescript below v1.7.10
* Bug fix: `transformed` transform-fn no longer factors into `pred` when an anonymous function during inline factoring
* Added :notpath metadata to signify pathedfn arguments that should be treated as regular arguments during inline factoring. If one of these arguments is not a static var reference or a non-collection value, the path will not factor. * Added :notpath metadata to signify pathedfn arguments that should be treated as regular arguments during inline factoring. If one of these arguments is not a static var reference or a non-collection value, the path will not factor.
* Bug fix: `transformed` transform-fn no longer factors into `pred` when an anonymous function during inline factoring
* Bug fix: Fixed nil->val to not navigate to the val on `false`
## 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

@ -416,9 +416,9 @@
nil->val nil->val
[v] [v]
(select* [this structure next-fn] (select* [this structure next-fn]
(next-fn (if structure structure v))) (next-fn (if (nil? structure) v structure)))
(transform* [this structure next-fn] (transform* [this structure next-fn]
(next-fn (if structure structure v)))) (next-fn (if (nil? structure) v structure))))
(def NIL->SET (nil->val #{})) (def NIL->SET (nil->val #{}))
(def NIL->LIST (nil->val '())) (def NIL->LIST (nil->val '()))

View file

@ -1011,3 +1011,9 @@
(dotimes [i 10] (dotimes [i 10]
(is (= [(inc i)] (select (s/transformed s/STAY #(+ % i)) 1))) (is (= [(inc i)] (select (s/transformed s/STAY #(+ % i)) 1)))
)) ))
;; test for issue #103
(deftest nil->val-regression-test
(is (= false (transform (s/nil->val true) identity false)))
(is (= false (select-one! (s/nil->val true) false)))
)