4 ms·
Explicit delimiters compose inside expressions much more gracefully. This is the main reason Python doesn't allow multi-line lambdas: if you have some significa
by munificent 12y ago
Explicit delimiters compose inside expressions much more gracefully. This is the main reason Python doesn't allow multi-line lambdas: if you have some significant indentation inside another expression, it's hard to tell how the rest of the expression following the unindent should be formatted.
CoffeeScript does handle this, but I've always felt it was a murky corner of the grammar.
- breuleux 12y agoYou can easily allow both, though. At worst you can simply turn off significant indent inside explicit delimiters.
- munificent 12y agoSure, but then you need to implement both ways to express the same thing, and then deal with the infinite arguments it will spawn between proponents of each camp.
- breuleux 12y agoTypically, what I do is just map the indent and dedent tokens directly to some suitable bracket pair, so the implementation is trivial. As for the infinite arguments, well, as a language designer, is that really your problem? I mean, that kind of stylistic argument is no different from the endless arguments about bracket placement in C-like languages, or comma placement, "a+b" versus "a + b", and so on. People quibble about the dumbest things, I say just let them.