From: nobu@... Date: 2016-07-26T01:59:02+00:00 Subject: [ruby-core:76565] [CommonRuby Feature#12623] rescue in blocks without begin/end Issue #12623 has been updated by Nobuyoshi Nakada. Description updated AFAIK, it has been proposed a few times. An objection is that `rescue` in `{}` block feels weird. ---------------------------------------- Feature #12623: rescue in blocks without begin/end https://bugs.ruby-lang.org/issues/12623#change-59793 * Author: Dmitriy Non * Status: Open * Priority: Normal * Assignee: ---------------------------------------- Hi there! There's pretty nice feature that we can use "short rescue" in method definitions: ~~~ruby def my_method raise '1234' rescue puts 'rescued' end ~~~ What about using this in blocks? ~~~ruby loop do n = enumerator.next # do something rescue StopIteration end ~~~ P.S. actually I am not sure if this FR was not created earlier but I couldn't google it. P.P.S sorry for my english -- https://bugs.ruby-lang.org/ Unsubscribe: