News for hackers. Stuff that matters.
Re:Toolz: A functional standard library for Python by omaranto on Friday January 22, 2021 @02:31AM (#25869357)
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.
Re:Toolz: A functional standard library for Python by pansa2 on Friday January 22, 2021 @03:16AM (#25869569)
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.
Re:Toolz: A functional standard library for Python by omaranto on Friday January 22, 2021 @05:54AM (#25870524)
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.
Re:Toolz: A functional standard library for Python by c-cube on Saturday January 23, 2021 @11:13AM (#25883304)
Nitpick : neither ocaml nor SML have significant whitespace.
Re:Toolz: A functional standard library for Python by omaranto on Saturday January 23, 2021 @12:12PM (#25884065)
You're right! It's been too long since I used them. I think I was probably remembering F#'s light syntax.