In Clojure, class obtains the Java class of an object, making JVM type identity available for interoperability and type checks. It belongs to the Java-oriented side of Clojure’s type and polymorphism facilities. section 15.0 section 15.2
Unlike type, class ignores a value’s :type metadata and reports the underlying Java class. Thus a metadata-tagged vector can have a custom type result while class still returns clojure.lang.PersistentVector. section 15.2
Checking a Java interface
Use instance? when the question is whether an object belongs to a class or implements an interface: (instance? java.lang.Number (bigint 1)) returns true, as does checking 1 against java.lang.Comparable.




















