title: How does Clojure ^:const work?
body: <p>I'm trying to understand what <code>^:const</code> does in clojure. This is what the dev docs say. <a href="http://dev.clojure.org/display/doc/1.3" rel="noreferrer">http://dev.clojure.org/display/doc/1.3</a></p>
  
  <blockquote>
    <p>(def constants
    {:pi 3.14
    :e 2.71})</p>
    
    <p>(def ^:const pi (:pi constants))
    (def ^:const e (:e constants))</p>
    
    <p>The overhead of looking up :e and :pi in the map happens at compile time, as (:pi constants) and (:e constants) are evaluated when their parent def forms are evaluated.</p>
  </blockquote>
  
  <p>This is confusing since the metadata is for the var bound to symbol <code>pi</code>, and the var bound to symbol <code>e</code>, yet the sentence below says it helps speed up the map lookups, not the var lookups.</p>
  
  <p>Can someone explain the what <code>^:const</code> is doing and the rationale behind using it? How does this compare to using a giant <code>let</code> block or using a macro like <code>(pi)</code> and <code>(e)</code>?</p>