On Jul 21, 9:59 pm, Pedro Teixeira <pedr...@gmail.com> wrote:
> On Jun 22, 6:23 pm, Krešimir Šojat <kso...@gmail.com> wrote:
>
> > While traversing the data structure both prewalk and postwalk remove
> > all the metadata:
>
> > user=> (require '[clojure.walk :as w])
> > nil
> > user=> (def data {:a ^{:a :this-is-a} [1 2 3]})
> > #'user/data
> > user=> (meta (:a data))
> > {:a :this-is-a}
> > user=> (meta (:a (w/postwalk identity data)))
> > nil
> > user=> (meta (:a (w/prewalk identity data)))
> > nil
>
> This is indeed annoying and not expected, anyone has already a patch
> for this?
>

into preserves the metadata:
=>(meta (:a (into {} {:a ^{:id 1} {}} )))
{:id 1}

There is some commented out code there:
http://github.com/clojure/clojure/blob/master/src/clj/clojure/walk.clj#L69

can anyone give a hint on how to change the walk function to preserve
metatada?
or otherwise, give an argument why it does not make sense to preserve
it?



-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to