17 May 01:31
Re: Matz: can we have rescue/else/ensure available in all blocks?
From: coderrr <coderrr.contact <at> gmail.com>
Subject: Re: Matz: can we have rescue/else/ensure available in all blocks?
Newsgroups: gmane.comp.lang.ruby.general
Date: 2008-05-16 23:31:52 GMT
Subject: Re: Matz: can we have rescue/else/ensure available in all blocks?
Newsgroups: gmane.comp.lang.ruby.general
Date: 2008-05-16 23:31:52 GMT
> How would you have "rescue" and "ensure" blocks when using "{" and "}",
> both of which are (almost) equivalent to "do" and "end"?
>
> pages.each {|page|
> ...
> }
>
>
pages.each { |page|
rescue SomeError
...
ensure
...
}
Or you could just not allow it for { }, only for do/end. I agree it looks
weird, and is probably more confusing when using it with { }.
- steve
http://coderrr.wordpress.com
RSS Feed