* look up the type of the thing * run the action on it
but can instead skip straight to step 2.
If you somewhere in your Clojure program (or repl) run (set! warn-on-reflection true) it will print to the console when you are doing reflection.
I think it's a good idea to put in the beginning of your core namespace - so that it is always on. Why not always wear the seatbelt when driving, you know?
There's no reason the average Clojure project ever need be using reflection for dispatch.
(defn [^WriteInterface o ^long n] (.write o n)) can be much faster because the compiler knows the type of o & n.
This is needed only when calling Java methods, because Java allows overloading. Clojure only does arity-overloading, not type overloading, and hence doesn't need the type info.
I'm a novice Clojure programmer and haven't previously heard of this. Can you please elaborate?