Welcome! Please see the About page for a little more info on how this works.

+40 votes
in Clojure by
closed by


user=> (set! *print-meta* true)
user=> (clojure.walk/postwalk identity ^:foo ())
user=> (clojure.walk/postwalk identity (with-meta (list 1 2 3) {:foo true}))
(1 2 3)

See JIRA issue: https://clojure.atlassian.net/browse/CLJ-2568
The JIRA issue was already there for a while. This ask issue was created so it can catch upvotes from the community. If you care, please upvote!

closed with the note: Released in 1.12.0-alpha8

2 Answers

+1 vote

It would be very helpful to see real examples where this matters - as we look into various tradeoffs it is difficult to understand use cases without more information about where you run into this.

One example is in edamame where I postwalk the body of a function literal. Because line numbers are dropped on lists / seqs (conses are not lists, but exist as a result of syntax quote) I needed to implement my own.

I think all serious code processing with clojure.walk suffers from the metadata issue. It loses ^:tag, locations etc.
0 votes

Alex Miller
May 31, 2020 at 9:54 PM

Something to consider is whether existing code modifies coll metadata during walk and will thus be broken by this change.

That's a question, is there an answer ?

Updated in JIRA issue