by tensor · 8y ago · 0 comments
func Foo(s string) string {
println("hello")
}
And in Clojure: (defn foo [s]
(println s))
The Go code has two () pairs and one {} pair. The Clojure has two () pairs and one [] pair. There aren't more overall parenthesis, they are just in a different place. Any decent editor will catch missing parens just as they would missing braces in other languages.There are some cases where you do get a few more parens, e.g. with mathematical operators, but overall it's not that different, it's almost completely user perception.
I don't want to have to think about which delimiter I need where. Knowing that it's always going to be a parenthesis makes my life so much easier.
(let ((x 1)
(y 2))
(+ x y))
In Clojure, it becomes: (let [x 1
y 2]
(+ x y))Granted, it's a bit easier to pick them out with square brackets, but for my taste I'd rather just have homegenous delimiters everywhere.
How often do you want to do that? Wouldn't you be more interested in what the variable is called or who it's passed to?