From: Christopher Dicely Date: 2009-04-20T02:01:29+09:00 Subject: Re: ruby1.9 and the retry keyword On Sun, Apr 19, 2009 at 9:50 AM, James Gray wrote: > On Apr 19, 2009, at 9:20 AM, Yoann Guillot wrote: > >> It seems that the 'retry' keyword is not supported anymore in ruby1.9 to >> restart a running iteration from the beginning. > > As Robert said, it's no longer supported in iteration.  It still works in a > rescue clause. > >> Is there a way to achieve the old behavior, preferably in a 1.8 compatible >> way ? > > You bet. > >> $ ruby1.8 -ve '[1, 2].each { puts "bla" ; retry }' > > loop do >  puts "bla" > end That mimics the example (where the retry is unconditional), but clearly isn't a general solution; If "redo" works on 1.9 (which is similar to retry, but different in conditions not relevant to the question), that may be the answer.