From: Yossef Mendelssohn Date: 2009-06-30T05:47:40+09:00 Subject: Re: RDoc-style documentation for Ruby keywords On Jun 29, 3:35 pm, Jörg W Mittag wrote: > Yossef Mendelssohn wrote: > > Maybe I'm misunderstanding the point of the 'else' clause, but > > wouldn't you put code that "only gets executed if none of the rescue > > clauses are (i.e., there is no exception)" in the main body of what > > you're adding rescues to? (viz. begin block, method definition) > > Counterexample: > > begin >   puts "According to your theory, this shouldn't be evaluated, " >   puts "but it will." >   raise RuntimeError > rescue > else >   puts "This, however, won't." > end I could have explained that better. I was thinking more along the lines of begin puts "This will be executed, " puts "as will this." raise puts "This, however, won't." rescue else put "And neither will this." end Rob's a-e example points out the benefit of using the else clause, but it's still strange and slippery to me. I've never run into a practical need for it, though I'm not inclined to disbelieve him when he says he has. It would be great to see a concrete example. -- -yossef