3 ms·
I don't see how it's a loss of orthogonality; just like a whitespace-insensitive language, it's saying that the choices of bracket and dot are syntactically equ
by lmm 12y ago
I don't see how it's a loss of orthogonality; just like a whitespace-insensitive language, it's saying that the choices of bracket and dot are syntactically equivalent. And that syntactic freedom means the precedence of a Scala line is often much clearer than the equivalent in other languages:
a b {c d (e f g.h(i))}
In Haskell you'd have to write that as something like:
a b (c d (e f (g h i)))
//or alternatively
a b $ c d $ e f $ g h $ i
- tel 12y agoI don't understand what you're trying to argue here. At least in this example, I cannot see how the Haskell version is not much more clear.
- lmm 12y agoI find it much easier to visually tell what the tree structure (AST) is in the Scala version, because of the different possible delimiters -the fact that a '(' must match a ')' and not a '}' makes it much easier to visually parse.