Non-numeric scalars and interning
Strings and characters in Clojure are the same as in Java. The string literals are implicitly interned. Interning is a way of storing only the unique values in the heap and sharing the reference everywhere it is required. Depending on the JVM vendor and the version of Java you use, the interned data may be stored in a string pool, Permgen, ordinary heap, or some special area in the heap marked for interned data. Interned data is subject to garbage collection when not in use, just like ordinary objects. Take a look at the following code:
user=> (identical? "foo" "foo") ; literals are automatically interned true user=> (identical? (String. "foo") (String. "foo")) ; created string is not interned false user=> (identical? (.intern (String. "foo")) (.intern (String. "foo"))) true user=> (identical? (str "f" "oo") (str "f" "oo")) ; str creates string false user=> (identical? (str "foo") (str "foo")) ; str does not create string for 1 arg true...