Hacker News new | past | comments | ask | show | jobs | submit login

Your mileage may vary. My experience with Racket's use of square brackets was different. When I first looked at Racket Code, I assumed square brackets had semantic significance (I'd seen some Lisps and Schemes and glanced at Clojure code snippets in addition to a number of non-lisp languages). I spent mental energy trying to identify why they were used one place and not another. It was only after a significant time that I realized they are merely stylistic flourishes.

As I have written Racket code, I have found that square brackets get in the way. Don't misunderstand me, they look great when the are printed, but changing the internal structure of an expression requires changing concluding logic from '))])))' to ')))]))' that I've decided it's pain than gain. I'd rather just add another close parenthesis and move on to running tests than navigate character by character.

I love Racket, don't misunderstand me. But the square brackets are a faster horse at best, not a bicycle.




> Don't misunderstand me, they look great when the are printed, but changing the internal structure of an expression requires changing concluding logic from '))])))' to ')))]))' that I've decided it's pain than gain.

But how is this different from Clojure? You can have exactly the same problem there[1]. Whenever you introduce irregularity to the syntax you're going to have these issues. Clojure does it for "readability" and so does Racket. The difference is that in Racket you can opt-out and only use normal parens, while you can't do this in Clojure - which is probably fine in their respective cases, as they target a bit different audiences I think.

[1] But you do use an editor which makes this kind of problem impossible to occur, right? Like Emacs with Paredit or DrRacket with correct settings?


It's not for readability in Clojure. [+ 1 2] and (+ 1 2) and '(+ 1 2) all evaluate to different values. The closest are [+ 1 2] and '(+ 1 2) as arguments to anything but `eval` or `seq?`. Under `eval` '(+ 1 2) is identical to (+ 1 2) under `seq?` [+ 1 2] and (+ 1 2) both evaluate to false.

As I said it's complicated.

In Racket on the other hand `))))))` is equivalent to `)))]]]` except in so far as matching goes. The brackets are just decorations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: