Ross Bamford wrote:
> On Thu, 2006-05-18 at 23:55 +0900, Daniel Schierbeck wrote:
>> I know this has been on the table before, but I really see no reason not 
>> to allow do/end blocks to have rescue clauses on them, i.e.
>> 
>>    foo do
>>      bar
>>    rescue
>>      baz
>>    end
> 
> Just playing Devil's Advocate, what'd happen with this:
> 
> 	File.open('somefile') do |f|
> 	  puts f.read
> 	end rescue puts "Can't open"
> 
> ?

What if rescue has more than one sentence? It seems not a good idea.
But I agree with Daniel Schierbeck's proposal.


-- 
Posted via http://www.ruby-forum.com/.