From: alxtskrnk@... Date: 2017-12-12T16:05:13+00:00 Subject: [ruby-core:84226] [Ruby trunk Feature#11256] anonymous block forwarding Issue #11256 has been updated by bughit (bug hit). nobu (Nobuyoshi Nakada) wrote: > Just to be clear, does it require both of the definition and the use, instead of only the latter? > > I mean this is allowed: > > ```ruby > def foo(&) > bar(&) > end > ``` > > but these are not: > > ```ruby > def foo() > bar(&) > end > > def foo(&block) > bar(&) > end > ``` `def foo(&)` is more self documenting so should be legal syntax, but should not be required because in general a method taking a block does not have to be marked. ---------------------------------------- Feature #11256: anonymous block forwarding https://bugs.ruby-lang.org/issues/11256#change-68347 * Author: bughit (bug hit) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: ---------------------------------------- since capturing a block into a proc is slow: foo(&block) and creating chains of blocks is kind of ugly and ultimately also inefficient: foo{yield} why not allow block forwarding without capturing: foo(&) foo(1, 2, &) -- https://bugs.ruby-lang.org/ Unsubscribe: