From: Ian Macdonald Date: 2004-01-11T10:58:37+09:00 Subject: Re: block delimiting On Fri 09 Jan 2004 at 04:33:15 +0900, Pete Yadlowsky wrote: > I like Ruby very much except for one thing: all those "end" tokens scattered > everywhere. For my style of coding, they are superfluous and, in my opinion, > only serve to clutter the code. They are not superfluous. You need a tangible block delimiter in order to be able to chain methods that take blocks. Take, for example, the following Ruby code: foo = %w(f e d c b a) foo.map do |x| x = rand(10).to_s + x end.sort => ["2b", "2c", "4f", "5a", "5e", "6d"] In Python, there's no delimiter to signify the end of the block, so you can't chain the output of methods that take blocks onto other methods. In the above case, chaining the map to the sort can't be done. > I very much like Python's indent blocking style and would like to use > it with Ruby. Indenting does everything I need it to do in terms of > establishing structure and enhancing readability. But not in terms of language functionality. Ian -- Ian Macdonald | "Absolutely nothing should be concluded System Administrator | from these figures except that no ian@caliban.org | conclusion can be drawn from them." (By http://www.caliban.org | Joseph L. Brothers, Linux/PowerPC Project) |