|
|
|
|
|
by jakebasile
1111 days ago
|
|
Clojure still uses S expressions, it just has more than just lists available. Square brackets don't make lists, they make vectors. Commas are always optional. I don't know what you mean by "arbitrary lists where pairs which belong together aren't grouped", but maybe you mean maps or sets, which are also not lists but a different data type. user=> (type [])
clojure.lang.PersistentVector
user=> (type '()) ; gotta quote the list
clojure.lang.PersistentList$EmptyList
user=> (type {})
clojure.lang.PersistentArrayMap
user=> (type #{})
clojure.lang.PersistentHashSet
Different data types are used for different things. Vectors have more natural insertion behavior, so most people use them where that might happen. user=> (conj '(1) 2)
(2 1)
user=> (conj [1] 2)
[1 2]
|
|