Hacker News new | ask | show | jobs
by ianhorn 2208 days ago
Lambdas can be multiline/multistep, but it's just as ugly as you'd expect. Maybe the most "pure" functional way to do it is to have multiple binds/applies/maps, so instead of something like `x=1; y=2; x + y` it's something like `1.apply(lambda x: 2.apply(lambda y: x + y)).` Still unreadable, but for different reasons. It's more about the grossness of using `xEmitter.map(lambda x: stuff with x in scope)` to bind x as a variable than it is about the inflexibility of lambdas.