News for hackers. Stuff that matters.
Re:Coconut – Pythonic functional programming language by merlincorey on Thursday June 23, 2016 @05:29PM (#11964447)
Python lambdas are explicitly artificially limited to a single expression. Python has statements which are not expressions, mostly control statements and looping constructs.
Re:Coconut – Pythonic functional programming language by fovc on Thursday June 23, 2016 @09:06PM (#11965517)
The syntax isn't the greatest, but you can get pretty far with Python's ternary expression. Generators in my experience remove the need for most loops. Where lambdas feel really subpar for me is the lack of 'let' and error-handling.
Re:Coconut – Pythonic functional programming language by Phrodo_00 on Thursday June 23, 2016 @09:22PM (#11965594)
While it IS a conscious decision to force lambdas to be a single expression, extending it to be able to be multiline would screw up with indentation being irrelevant inside of a function call too.