[/F] > maybe adding an (optional but encouraged) "return" > to lambda would be an improvement? > > lambda x: x + 10 > > vs. > > lambda x: return x + 10 > > or is this just more confusing... opinions? It was an odd complaint to begin with, since Lisp-heads aren't used to using "return" anyway. More of a symptom of taking a shallow syntactic approach to a new (to them) language. For non-Lisp heads, I think it's more confusing in the end, blurring the distinction between stmts and expressions ("the body of a lambda must be an expression" ... "ok, i lied, unless it's a 'return' stmt). If Guido had it to do over again, I vote he rejects the original patch <wink>. Short of that, would have been better if the lambda arglist required parens, and if the body were required to be a single return stmt (that would sure end the "lambda x: print x" FAQ -- few would *expect* "return print x" to work!). hindsight-is-great<wink>-ly y'rs - tim
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4