Permalink
Browse files

make -> and ->> metadata-aware Fixes #206

Signed-off-by: Chouser <chouser@n01se.net>
  • Loading branch information...
1 parent 4115b53 commit 749a0ad8b66c781d8176833f0ad26cfe6b9b24e3 @cgrand cgrand committed with Chouser Oct 23, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/clj/clojure/core.clj
View
@@ -1074,8 +1074,9 @@
second item in the first form, making a list of it if it is not a
list already. If there are more forms, inserts the first form as the
second item in second form, etc."
+ ([x] x)
([x form] (if (seq? form)
- `(~(first form) ~x ~@(next form))
+ (with-meta `(~(first form) ~x ~@(next form)) (meta form))
(list form x)))
([x form & more] `(-> (-> ~x ~form) ~@more)))
@@ -1085,7 +1086,7 @@
list already. If there are more forms, inserts the first form as the
last item in second form, etc."
([x form] (if (seq? form)
- `(~(first form) ~@(next form) ~x)
+ (with-meta `(~(first form) ~@(next form) ~x) (meta form))
(list form x)))
([x form & more] `(->> (->> ~x ~form) ~@more)))

0 comments on commit 749a0ad

Please sign in to comment.