Michael Neumann schrieb:
> Dave Thomas wrote:
>> Do we really need retry in blocks at all? Is it ever used in practice?
> No! And those few pieces of code (I only ever used it once in one place 
> during the last 8 years) could be easily changed into a loop.
> Get rid of it! :)

I didn't recognize the possibility to use 'retry' in a method body when an block 
is there when the method is called, but I saw other strange things related to 
the usage of 'retry' in a block earlier...

class Otto
   def a
     puts "In 'a'"
     self
   end
   def b
     puts "In 'b'"
     self
   end
   def c
     puts "In 'c'"
     yield
   end
end
p = 2
(puts "before 'Otto'"; Otto).new.a.b.c{retry if (p-=1) > 0}

=>

before 'Otto'
In 'a'
In 'b'
In 'c'
before 'Otto'
In 'a'
In 'b'
In 'c'

..., because the whole method chain is evaluated again. This combined with the 
new possible syntax...

(puts "before 'Otto'"; Otto)
   .new
   .a
   .b
   .c{retry if (p-=1) > 0}

...is really a little bit strange.

Wolfgang NĂ¡dasi-Donner