diff --git a/README.md b/README.md index a1dfd60..e49401b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/project.clj b/project.clj index 0580d4d..084cb2d 100644 --- a/project.clj +++ b/project.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" diff --git a/src/net/cgrand/xforms.cljc b/src/net/cgrand/xforms.cljc index f86450c..28deba9 100644 --- a/src/net/cgrand/xforms.cljc +++ b/src/net/cgrand/xforms.cljc @@ -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#)