From: "mame (Yusuke Endoh)" Date: 2021-11-21T16:26:43+00:00 Subject: [ruby-core:106195] [Ruby master Feature#11256] anonymous block forwarding Issue #11256 has been updated by mame (Yusuke Endoh). bughit (bug hit) wrote in #note-21: > That only makes sense if `def foo` comes to mean the block is not allowed. From what I understand, matz is for this. Passing a block to `def foo` might be prohibited in the future (I guess it is very far even if possible, though). If a method receives a block, it should have a `&block` parameter or `...` argument forwarding. For the compatibility, a method whose body has `yield` or `super` keywords might be also allowed. Actually @ko1 tried it in #15554. He withdrew the proposal because he have discovered a code pattern that makes false positives inevitable, but if matz accepts the incompatibility, the proposal might be a good first step. Matz said he will create a ticket to discuss it, so please wait for him about the details. ---------------------------------------- Feature #11256: anonymous block forwarding https://bugs.ruby-lang.org/issues/11256#change-94799 * Author: bughit (bug hit) * Status: Closed * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- 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: