3 ms·
Clojure's lists are effectively cons cells. Clojure's vectors and maps are immutable hash array map tries. => (class (read-string "(some list)")) cloju
by wtetzner 3y ago
Clojure's lists are effectively cons cells. Clojure's vectors and maps are immutable hash array map tries.
=> (class (read-string "(some list)"))
clojure.lang.PersistentList
They are written in Java, and implement a bunch of interfaces, so the implementation looks complicated, but they are basically just classes with _first and _rest fields.
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentList.java#L20 https://github.com/clojure/clojure/blob/master/src/jvm/cloju...