3 ms·
There are valid criticisms of lisp syntax, but I'm not sure this is one of them. This kind of mistake [writing f(g(x,y)) where you want f(g(x),y)] is easy to ma
by philh 12y ago
There are valid criticisms of lisp syntax, but I'm not sure this is one of them. This kind of mistake [writing f(g(x,y)) where you want f(g(x),y)] is easy to make and (sometimes) hard to spot in many languages.
- lmm 12y agoHonestly I think lisp would gain a lot just by having more choices of paired delimiter. The fact that [ has to match ], < has to match >, { has to match } and ( has to match ) is a huge aid to visually understanding the AST of some code. The fact that in lisp e.g. array accesses are not different from function calls, or that blocks are not different from expressions, is a great advantage, but we would do better to preserve the option of using several different delimiters.
- fineIllregister 12y agoRacket (a Scheme dialect, not CL) allows us of brackets [] and curly braces {} in place of parentheses.
- chaitanya 12y agoThe great thing about Common Lisp is that if you really want to use another paired delimiter, you can using reader macros e.g. it is quite trivial to translate [1 2 3] into (vector 1 2 3) and now you have more conventional looking array literals.
- lmm 12y agoThe terrible thing is that this is not standardized, so every codebase ends up with a slightly different version of what [ means.
- dragonwriter 12y ago> Honestly I think lisp would gain a lot just by having more choices of paired delimiter. Many lisps either allow alternate paired delimiters in general or demand them for specific constructs (or both -- Racket and many Schemes do both, and all Schemes do at least the latter.)