|
|
|
|
|
by codetrotter
2908 days ago
|
|
> I don't know what you would lose by having if as an expression Well, if you turn if into an expression the way that you indicated then now you will also need the equivalent of the “begin” expression in order to be able to have multiple statements and/or expressions in either branch. So then you are breaking backwards compatibility. Which makes it a non-starter from the get go. And like I said there is also the fact that functions need the return keyword in Python if you want to return a value. |
|
Ruby returns the last thing in a method, which I feel is pretty sane.