Hacker News new | ask | show | jobs
by omaranto 1981 days 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.
2 comments

The 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.
It 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.
Nitpick : neither ocaml nor SML have significant whitespace.
You're right! It's been too long since I used them. I think I was probably remembering F#'s light syntax.