for was not emitting kv pairs in cljs because of extra compiler metadata, fix #13
This commit is contained in:
parent
5ea2d1b3d3
commit
362febaf5f
3 changed files with 6 additions and 3 deletions
|
|
@ -21,7 +21,7 @@ Transducing contexts: `transjuxt` (for performing several transductions in a sin
|
|||
Add this dependency to your project:
|
||||
|
||||
```clj
|
||||
[net.cgrand/xforms "0.9.1"]
|
||||
[net.cgrand/xforms "0.9.2"]
|
||||
```
|
||||
|
||||
```clj
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
(defproject net.cgrand/xforms "0.9.1"
|
||||
(defproject net.cgrand/xforms "0.9.2"
|
||||
:description "Extra transducers for Clojure"
|
||||
:url "https://github.com/cgrand/xforms"
|
||||
:license {:name "Eclipse Public License"
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
(macros/deftime
|
||||
|
||||
(defn- no-user-meta? [x]
|
||||
(= {} (dissoc (or (meta x) {}) :file :line :column :end-line :end-column)))
|
||||
|
||||
(defmacro for
|
||||
"Like clojure.core/for with the first expression being replaced by % (or _). Returns a transducer.
|
||||
When the first expression is not % (or _) returns an eduction."
|
||||
|
|
@ -40,7 +43,7 @@
|
|||
nested-reduceds (core/for [[expr binding] rpairs
|
||||
:when (not (keyword? binding))]
|
||||
`reduced)
|
||||
body (build `(let [acc# (~rf ~acc ~@(if (and (pair? body-expr) (nil? (meta body-expr)))
|
||||
body (build `(let [acc# (~rf ~acc ~@(if (and (pair? body-expr) (no-user-meta? body-expr))
|
||||
body-expr
|
||||
[body-expr]))]
|
||||
(if (reduced? acc#)
|
||||
|
|
|
|||
Loading…
Reference in a new issue