I am learning Clojure. However, I do not have a good understanding for language and philosophy.
But I want to be more familiar with the language. hence I started reading Clojure's basic API documentation and found some interesting things in the source code clojure.core/get.
(defn get
"Returns the value mapped to key, not-found or nil if key not present."
{:inline (fn [m k & nf] `(. clojure.lang.RT (get ~m ~k ~@nf)))
:inline-arities #{2 3}
:added "1.0"}
([map key]
(. clojure.lang.RT (get map key)))
([map key not-found]
(. clojure.lang.RT (get map key not-found))))
To get a value with a given key, a function is used in the code clojurelang.RT/get. The code calls the dot operator - (. clojure.lang.RT (get map key)).
My question is why the author wrote (. clojure.lang.RT (get map key))instead
(clojure.lang.RT/get map key).
Is there any technical difference? or any benefit?
source
share