News for hackers. Stuff that matters.
Re:Coconut – Pythonic functional programming language by brianwawok on Thursday June 23, 2016 @12:06PM (#11962057)
Well, or write a static method somewhere that you call. Sum is used a lot, so handy it is written somewhere (vs having to do a lambda x + x thing.
Re:Coconut – Pythonic functional programming language by nawitus on Thursday June 23, 2016 @02:14PM (#11963175)
That seems like an argument against lambda functions in general - why use lambdas when you can define a static function for every case? Well, the answer in my opinion is because it makes code more readable if you can define a simple lambda function instead of having to name every single function in the code base.
Re:Coconut – Pythonic functional programming language by brianwawok on Thursday June 23, 2016 @03:25PM (#11963704)
Well if you are going to reuse the function, name it. If it is a 1 time thing, use a lambda.
Re:Coconut – Pythonic functional programming language by quietwhisper on Thursday June 23, 2016 @06:14PM (#11964695)
Sounds great in theory. Problem is if you need a lambda that isn't a single expression, you then have to name it. Welcome to the conversation.