title: Why do int arrays bound with 'def' accept Long values in Clojure?
body: <p>I've noticed that if I <code>def</code> an int array and set an element in the array with a Long, then there are no complaints.  However if I bind the int array in a <code>let</code> block set an element with a Long, then an IllegalArgument exception is thrown.  Could someone help me understand why this is?</p>
  
  <p>The code below demonstrates the discrepancy. I tried it in both Clojure 1.8 and the latest beta version of 1.9 and got these results.</p>
  
  <pre class="lang-clj prettyprint-override"><code>(def a (int-array 10))
  (aset a 0 Long/MAX_VALUE) ;; sets first element to -1
  
  (let [b (int-array 10)]
    (aset b 0 Long/MAX_VALUE)) ;; throws java.lang.IllegalArgumentException: Value out of range for int:
  </code></pre>