Metadata Preservation in Clojure
<p>From <a href="https://funcool.github.io/clojurescript-unraveled/" rel="nofollow">ClojureScript Unraveled</a>:</p>

<blockquote>
  <p>As long as the functions that derive new data structures return
  collections with the same type, metadata will be preserved; this is
  not true if the types change due to the transformation.</p>
</blockquote>

<p>Yet</p>

<pre><code>(def v (with-meta [0 1 2 3] {:foo :bar}))
;; =&gt; [0 1 2 3]

(def sv (subvec v 0 2))
;; =&gt; [0 1]

(meta sv)
;; =&gt; nil ; where did the metadata?
</code></pre>

<p>Why is the metadata lost? Doesn't <code>subvec</code> return a collection with the same type as <code>v</code>, namely a vector?</p>