Can't say anything about optimization by the compiler (although I would be surprised if it was able to change a lot about your bit-get
code), but - to take matters into your own hands - you could just rely on the lower-level logical operations bit-shift-right
and bit-and
, e.g.:
(defn bit-get [x n]
(bit-and (bit-shift-right x n) 1))