title: Metadata on Composite Functions (i.e. when using comp)
body: <p>I'm using Clojure 1.5.1 and I just encountered the following on my (Leiningen) REPL:</p>
  
  <pre><code>(let [inc-x ^:some-metadata (comp inc :x)]
    (meta inc-x)) ;; =&gt; nil
  </code></pre>
  
  <p>No metadata attached. When I write out the function, though:</p>
  
  <pre><code>(let [inc-x ^:some-metadata (fn [m] (-&gt; m :x inc))]
    (meta inc-x)) ;; =&gt; {:some-metadata true}
  
  ;; more closely to `comp`
  (let [inc-x ^:some-metadata (fn [&amp; args] (-&gt; (apply :x args) inc))]
    (meta inc-x)) ;; =&gt; {:some-metadata true}
  </code></pre>
  
  <p>Aha, maybe the result of <code>comp</code> can just not deal with metadata. Nope, it can:</p>
  
  <pre><code>(let [inc-x (with-meta (comp inc :x) {:some-metadata true})]
    (meta inc-x)) ;; =&gt; {:some-metadata true}
  </code></pre>
  
  <p>I guess the reader cannot handle <code>^:some-metadata</code> correctly here. Any ideas why?</p>
  
  <p><strong>FYI</strong>: <code>constantly</code> shows the same behaviour, so does <code>complement</code>and probably a series of others.</p>