This is exactly why I don’t like the “implicit pairs” syntax in Clojure. In Scheme, I don’t mind that extra pair of parantheses, but as someone who likes to fit everything into an 80 character line, I often find myself adding a line break between a binding and its value, which is really awkward to read if all bindings are stacked on top of each other without clear visual separation. Empty lines in between binding pairs make reading a bit easier, but they create even more gaps.
Also, long let-vectors with strict indentation often create huge gaps which lose visual cohesion. If the binding values are larger expressions, it seems like they are just lost somewhere in the void. With parantheses around each binding, there would be at least some structural unity to this mess.
Maybe some kind of typographic indentation guide in code editors like a dotted horizontal line would really help here.
An illustrative (and stupid) example:
(let [some-really-long-binding-name (fn [x y z]
(* x
(+ y z 1 2 3 (+ 4
(* 2
x
y)
foo bar
short-name (->> v
(map my-mapping-fn)
(filter nil?)
(apply +)
(reduce (fn [acc x]
(assoc acc x))
[])
x "help me, I am lost"]
…)
vs with extra parantheses (I think square brackets would be most idiomatic here):
(let [[some-really-long-binding-name (fn [x y z]
(* x
(+ y z 1 2 3 (+ 4
(* 2
x
y)]
[foo bar]
[short-name (->> v
(map my-mapping-fn)
(filter nil?)
(apply +)
(reduce (fn [acc x]
(assoc acc x))
[])]
[x "help me, I am lost"]]
…)
Even though they don’t help much with the huge gaps in indentation, the parantheses at least provide structural separation and I can quickly jump to the closing bracket with my cursor and take advantage of structural editing.
First example with stacked bindings and empty lines in between:
(let [some-really-long-binding-name
(fn [x y z]
(* x
(+ y z 1 2 3 (+ 4
(* 2
x
y)
foo
bar
short-name
(->> v
(map my-mapping-fn)
(filter nil?)
(apply +)
(reduce (fn [acc x]
(assoc acc x))
[]))
x
"help me, I am lost"])
vs with extra parantheses:
(let [[some-really-long-binding-name
(fn [x y z]
(* x
(+ y z 1 2 3 (+ 4
(* 2
x
y)]
[foo
bar]
[short-name
(->> v
(map my-mapping-fn)
(filter nil?)
(apply +)
(reduce (fn [acc x]
(assoc acc x))
[]))]
[x
"help me, I am lost"]])