3 ms·
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
by neilv 4y ago
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/ 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/ 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.
- lispm 4y agosquare brackets was already used in Scheme and even in Interlisp...
- tmtvl 4y agoYeah, in R6RS square brackets are considered to be perfectly interchangeable with regular parentheses. That decision was reversed for R7RS-small, though.
- lispm 4y agoIt'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 https://dl.acm.org/doi/pdf/10.1145/800017.800513 Interlisp used it in the 70 already.