On 8 Aug 2009, at 08:02 , Steven D'Aprano wrote: > On Fri, 7 Aug 2009 08:22:14 pm Kristján Valur Jónsson wrote: >> Unless I am very much mistaken, this is the approach Ruby takes. >> Everything is an expression. For example, the value of a block is >> the value of The last expression in the block. > > Copying what other languages do is not necessarily a bad thing, but > that > would fail both "explicit is better than implicit" and "in the face of > ambiguity, avoid the temptation to guess". The first objection one might be able to give, you maybe, but the second one? Where's the ambiguity in "compound statements return the result of the last evaluated expression"? > It's not immediately obvious to me why the last expression should be > given that privileged rule. Why not the first expression? > Because it wouldn't make any sense? When you're computing something, the value you want is the one at the end of the computation (usually called a result), not some random one somewhere else.
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