On Wed, 15 Jan 2014 12:09:38 +0100
Arvin Schnell <[email protected]> wrote:

> 
> Hi,
> 
> I was looking for a until loop in Ruby and found this:
> 
>   begin
>     <code>
>   end until <condition>
> 
> It is heavily used in the generated code. Unfortunately the Ruby
> inventor himself doesn't like this and would like to remove it,
> see:
> 
>   http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/6741
> 
> AFAIS there's no real until loop in Ruby. The common suggestion
> is to use loop:
> 
>   loop do
>     <code>
>     break <condition>
>   end
> 
> Is that true? Or do newer Ruby version offer a real until loop?
> 
> Regards,
>   Arvin
> 

Hi Arvin,
I am not aware of any change in newer ruby. In fact in loops aren't
much used in object languages, because you more often iterate over
collection so something like
collection.each
is used. 
Even if Matz above mention that we would like to remove it, I
think that because he do not remove it for eight years, he cannot
easily remove it, so you can use it. If you place here code you would
like to do, there is always way how to do it without until.

Josef
-- 
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to