42 ms·
I think it is due to the statement/expression dichotomy that Python exhibits. Python's lambda doesn't allow the use of statements (correct me if I'm wrong I ha
by brushbox 18y ago
I think it is due to the statement/expression dichotomy that Python exhibits.
Python's lambda doesn't allow the use of statements (correct me if I'm wrong I haven't written Python in a few years and they may have "fixed" this).
Meanwhile Ruby only allows expressions too - the catch here is that everything in Ruby is an expression.
- staticshock 18y agoThey don't plan to fix this, it's part of the core philosophy
- duane 18y agoA lambda is traditionally a functional programming product--think Lambda Calculus. Functional programming doesn't have statements, and neither should lambdas. Or do you mean anonymous function, in which case you're right.