From: Brian Candler Date: 2009-04-20T17:43:18+09:00 Subject: Re: ruby1.9 and the retry keyword Or using throw/catch. You can also factor out the pattern, for example: def retryable loop do catch(:retry) do yield return end end end ary = [:foo, :bar, :baz, :foo] def foo(e) :bom end retryable do ary.each { |e| case e when :foo ary[ary.index(e)] = foo(e) when :bom ary[ary.index(e)] = :foobom # to show retry when :baz ary[ary.index(e), 12] = [:flublu] throw :retry end } end p ary __END__ [:foobom, :bar, :flublu] -- Posted via http://www.ruby-forum.com/.