Hi,

In message "Re: Rescue clauses on do/end blocks?"
    on Fri, 19 May 2006 01:26:09 +0900, uncutstone wu <uncutstone / sina.com> writes:

|I think the syntax would be changed as below:
|        File.open('somefile') do |f|
|	  puts f.read
| 	rescue
|          puts "Can't open"
|        end

Which do you expect from above code?

(a)
        File.open('somefile') do |f|
          begin
	    puts f.read
 	  rescue
            puts "Can't open"
          end
        end

(b)
        begin
          File.open('somefile') do |f|
	    puts f.read
          end
        rescue
          puts "Can't open"
        end

It's naturally (a) from my point of view, since I know how blocks work
internally.  But as you did, many might expect (b).  This ambiguity
may become serious disadvantage.

							matz.