From: shibata.hiroshi@... Date: 2014-01-30T06:16:47+00:00 Subject: [ruby-core:60277] [ruby-trunk - Feature #7882] Allow rescue/else/ensure in do..end Issue #7882 has been updated by Hiroshi SHIBATA. Target version changed from 2.1.0 to current: 2.2.0 ---------------------------------------- Feature #7882: Allow rescue/else/ensure in do..end https://bugs.ruby-lang.org/issues/7882#change-44759 * Author: Charlie Somerville * Status: Assigned * Priority: Normal * Assignee: Yukihiro Matsumoto * Category: * Target version: current: 2.2.0 ---------------------------------------- =begin The keywords (({rescue})), (({else})) and (({ensure})) can be used when defining methods like so: def foo # rescue # else # ensure # end However when using a block delimited by do..end, you must use (({begin}))..(({end})) as well: foo do begin # ... rescue # ... # ... end end It would be nice to be able to drop the extra (({begin}))..(({end})) and use (({rescue})), etc. clauses directly: foo do # ... rescue # ... # ... end I cannot think of any ambiguities this syntax would cause, but please correct me if I am wrong. =end -- http://bugs.ruby-lang.org/