upvote
Square brackets’ use is very consistent and rather logical in how they are used in Clojure’s syntax.

When round brackets are used, the first element in the list defines how the rest of the list is interpreted, for example:

(func a b c) — run a function with its parameters

(macro x y z) — expand a macro with its parameters

([p q r] …) — “bare” function body that starts with a vector of parameters, and executable forms follow.

Square brackets are used where elements are the same “kind”, and the first one is not special, e.g.:

(defn f [a b c] …) — a collection of same-kind parameters, the first parameter is not special

(let [a 1 b 2] …) — a collection of bindings, the first binding is not special

The only exception that comes to mind is grouping multiple matching elements in `case`, but it for ergonomics.

Once I got the logic, when which is used, I changed my mind, and ever since I’ve felt it’s beautiful.

reply
Thanks a lot, that's a very interesting way of seeing it.
reply
You can... just not use square (and curly) brackets. Instead of `[1 2 3]` just write `(array 1 2 3)`. Instead of `(fn [x] (+ 1 x))` just write `(f (x) (+ 1 x))`. They are never necessary.
reply
Huh! So like some Schemes and Racket? Yet I must read them in code that isn't mine, which is a large part of the problem.
reply