From: "Eregon (Benoit Daloze)" Date: 2021-11-19T19:54:19+00:00 Subject: [ruby-core:106178] [Ruby master Feature#11256] anonymous block forwarding Issue #11256 has been updated by Eregon (Benoit Daloze). bughit (bug hit) wrote in #note-21: > A naked `&` is just documentation then. It has not material effect. It makes no sense to force such a noop modifications of method signatures to be able to forward blocks anonymously. If the block can be present it should be forwardable. It's extremely useful documentation/reading help that the method accepts a block. If people have to scan for `&` in the whole method to know if a method accepts a block, it's really annoying (a `yield` keyword is much easier to spot). I strongly agree with matz on this, methods taking a block should be clear about it, including in the parameters. > The result of this complexity reduction is an incoherent restriction that cannot be justified logically. Considering that the more complex proper implementation already exists, it's worth keeping it. matz said no. Please have some understanding that people implementing Ruby might know better about this and complexity. ---------------------------------------- Feature #11256: anonymous block forwarding https://bugs.ruby-lang.org/issues/11256#change-94782 * 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: