Hi --

On Sat, 21 Oct 2006, Sam Roberts wrote:

> On Sat, Oct 21, 2006 at 01:11:36AM +0900, dblack / wobblini.net wrote:
>> Did you see Austin's by_* methods?
>>
>>   string.lines   # an array
>
>>   string.by_lines { }   # enumeration (no intermediate array)
>
> This is identical to ruby1.8's string.each_line {}
>
>>   string.by_lines       # enumerator (or your "something"?)
>
> This is identical to ruby1.9's string.each_line.
>
>> I really like that way of breaking it out.
>
> I like the functionality, and #lines, but why not keep using "each_"
> instead of "by_"?

I personally think that by_ is a better choice for something that
might or might not take a block.  But the most important thing in my
paraphrase of Austin is the difference between the by_lines ones and
the plain lines one.


David

-- 
                   David A. Black | dblack / wobblini.net
Author of "Ruby for Rails"   [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB's Weblog)        [2] | Co-director, Ruby Central, Inc.   [4]
[1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com    | [4] http://www.rubycentral.org