[#106341] [Ruby master Bug#18369] users.detect(:name, "Dorian") as shorthand for users.detect { |user| user.name == "Dorian" } — dorianmariefr <noreply@...>
Issue #18369 has been reported by dorianmariefr (Dorian Mari辿).
14 messages
2021/11/30
[#106351] [Ruby master Bug#18371] Release branches (release information in general) — "tenderlovemaking (Aaron Patterson)" <noreply@...>
Issue #18371 has been reported by tenderlovemaking (Aaron Patterson).
7 messages
2021/11/30
[ruby-core:106195] [Ruby master Feature#11256] anonymous block forwarding
From:
"mame (Yusuke Endoh)" <noreply@...>
Date:
2021-11-21 16:26:43 UTC
List:
ruby-core #106195
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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>