4 ms·
Plenty of languages with significant-whitespace have multiline anonymous functions, like Haskell, Standard ML, Ocaml, etc. Maybe it's no possible in Python for
by omaranto 6y ago
Plenty of languages with significant-whitespace have multiline anonymous functions, like Haskell, Standard ML, Ocaml, etc. Maybe it's no possible in Python for a student reason, but the reason is not that the syntax is bad on indentation.
- pansa2 6y agoThe syntaxes of those languages are fundamentally different from Python’s. They don’t have an “expressions may not contain statements” rule - they don’t even have statements.
- omaranto 6y agoIt sounds like you agree with me: the reason Python does not have multiline lambdas is not that it has significant-whitespace, but other decisions including the “expressions may not contain statements” rule.
- c-cube 6y agoNitpick : neither ocaml nor SML have significant whitespace.
- omaranto 6y agoYou're right! It's been too long since I used them. I think I was probably remembering F#'s light syntax.