Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agreed.

Using square brackets in place of some parens is something some of the Racket professors started doing. I assumed it was because they thought it would be helpful to teach high school students in http://htdp.org/ . I defer to them on teaching, but I think it looks ugly, is harder to type, and seems like it's more confusing in code examples (people thinking it's significant, when it's not).

One thing I did do is make an Emacs mode, https://www.neilvandyke.org/quack/ , in which typing square brackets instead inserts parentheses when appropriate. This is helpful on US keyboards, on which parens require a multi-key press but square brackets do not.



square brackets was already used in Scheme and even in Interlisp...


Yeah, in R6RS square brackets are considered to be perfectly interchangeable with regular parentheses. That decision was reversed for R7RS-small, though.


It's much older. Here is a (legendary) paper on Lisp using Scheme with square brackets from 1983.

https://dl.acm.org/doi/pdf/10.1145/800017.800513

Interlisp used it in the 70 already.




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

Search: