2 ms·
> After writing Clojure for a few years, there were several times where I ended up with a complex function with unbalanced parens, and the only way I could fix
by soegaard 4y ago
> After writing Clojure for a few years, there were several times where I ended up with a complex function with unbalanced parens, and the only way I could fix it was to basically re-write the function piece by piece.
That's the punishment for removing some of the "reduntant" parentheses from Scheme.
Compare
Clojure: (let [a 1
b 2]
(+ a b))
Scheme: (let ([a 1]
[b 2])
(+ 1 2))
If for some reason, say, `b` get deleted a Scheme compiler can tell you which binding pair has a problem.
In more complicated setups, in Scheme/Racket I indent the piece of code,
and from the indentation I can see, where end parenthesis is missing.