From: Phlip Date: 2008-09-21T05:32:15+09:00 Subject: Re: for or each? tekwiz wrote: > This is what roodi would have me do > > (0...str.size).each do |i| > ... > end > > Is there a real, substantive reason to use each instead of for? Or is > it simply just a preference issue? It leaves you closer to a refactor to .map or .inject or .select or .reject or .delete_if or .each_index or .each_with_index or ... -- Phlip http://www.oreillynet.com/ruby/blog/2008/09/polygamous_assert_latest.html