On 12/13/13, 3:21 AM, Christophe Grand wrote:
> Having to opt in for the "correct" behaviour is weird.
this assumes that the current behavior is incorrect, which is sort of
short sighted. it would certainly be more convenient in some cases if
macro expansion preserved metadata, but intuitively macros substitute
one data structure for another, and from that understanding it does not
follow metadata should be preserved.
I guess generally over time more and more data transformations in
clojure (cons on various datastructures, clojure.walk, etc) to preserve
metadata, but I am pretty sure data transforms preserving metadata is
not a universal guarantee that clojure provides.
given that, there is no "correct" behavior, there is only behavior that
is more or less convenient in different circumstances. Dictating those
kind of choices up front tends to lead to pain later, so some kind of
tagging to allow users to make the choice seems fine.
even if the patch does go in, metadata is not always preserved, if the
macro returns something that metadata cannot be attached to, you just
cannot propagate metadata. so this patch replaces a universal guarantee
"macro expansions clobber metadata" with a provisional guarantee "macro
expansion preserves metadata if it can". as a general rule I think
universal guarantees are more valuable.
obviously lots of people have voted for this issue, so they must think
it is important, but I have never been bitten by it, so leaving it out
indefinitely sounds fine to me :)
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?