From: Yoann Guillot Date: 2009-04-20T03:17:54+09:00 Subject: Re: ruby1.9 and the retry keyword On Mon, Apr 20, 2009 at 02:10:33AM +0900, James Gray wrote: > On Apr 19, 2009, at 12:01 PM, Christopher Dicely wrote: > >> That mimics the example (where the retry is unconditional), but >> clearly isn't a general solution; > > I'll be surprised if more complex examples can't be similarly converted > fairly easily. That was kind of my point. I meant the code to say, take > a step back and think what is this trying to do? > My code walks an array, and may change the current element, which is allowed without breaking the iteration. I have also a special case where i have to change a whole subsection of the array, this was the case where i used 'retry' eg ary.each { |e| case e when foo ary[ary.index(e)] = foo(e) when bar when ... when baz ary[ary.index(e), 12] = [flublu] retry end } Sure, i could use map or many other ways, my code is quite ugly anyway. I was just surprised by the change of behavior. I don't see the point in removing capabilities from the language (restarting an iteration from within), but I can sure live with it. -- Yoann