On Wed, Feb 1, 2012 at 1:22 AM, botp <botpena / gmail.com> wrote:
> On Wed, Feb 1, 2012 at 6:16 AM, Robert Klemme
> <shortcutter / googlemail.com> wrote:
>> it's a loop in which case the code often becomes more elegant, e.g.:
>>
>> while ( line = gets )
>
> i dont know, Robert,    
>
>    
>
> also elegant.
> if ruby would support that, wouldn't it be elegant?

I find

something.each do |line, x, y|
  ...
end

more elegant and idiomatic Ruby.  That's why I typically use

ARGF.each do |line|
  ...
end

instead of while ( line = gets ).

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/