The .
(dot) sperial form is the weirdest of them all. Not sure if I'm going to explain it well, but let's try.
Per docs:
If the first operand is a symbol that resolves to a class name, the access is considered to be to a static member of the named class. Note that nested classes are named EnclosingClass$NestedClass, per the JVM spec. Otherwise it is presumed to be an instance member and the first argument is evaluated to produce the target object.
Emphasis mine.
So you have hit the first case with (. clojure.lang.IPersistentMap isInstance {})
- clojure.lang.IPersistentMap
resolves to class name and the whole expression is assumed to be a static method call.
In the map
case the symbol is evaluated (the part with emphasis), evaluates to clojure.lang.IPersistentMap
class object before being passed to the anonymous function and the whole expression is an instance method call on that class.
So it boils down to the fact that in one place the clojure.lang.IPersistentMap
is being used as a symbol that refers to a class name and in the other as something that evaluates to a class object.
Also look here:
Note that class names normally denote class objects, but are treated specially in certain special forms, e.g. '.' and new.