Hi --

On Mon, 25 Sep 2006, Devin Mullins wrote:

> dblack / wobblini.net wrote:
>>>  a=readlines.each{|i|i.split(" ").each{|j|j=j.to_i}}
>> That just assigns the lines you've read in, unchanged, to a.
> That was a paste-o on my part. My point was that the functional means of 
> doing things don't tend to golf well. Compare:
>  a.map{|b|b.to_i}.each{|c|}
>  a.each{|b|c=b.to_i}

Doesn't it depend what you need, though?  Also, you can always do the
each-like side-effect stuff with map, but not the map-like stuff with
each.


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