[#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:106114] [Ruby master Feature#16252] Hash#partition should return hashes
From:
"knu (Akinori MUSHA)" <noreply@...>
Date:
2021-11-18 05:24:05 UTC
List:
ruby-core #106114
Issue #16252 has been updated by knu (Akinori MUSHA).
I only wish `partition` had been changed this way along with `select`/`reject`...
From my experience, `partition` is likely used in business logic, so it is not safe to break the compatibility judging from public code search. In today's developer meeting, we discussed this and many pointed out that this functionality should have a new name, keeping `partition` as it is now.
----------------------------------------
Feature #16252: Hash#partition should return hashes
https://bugs.ruby-lang.org/issues/16252#change-94709
* Author: Dan0042 (Daniel DeLorme)
* Status: Open
* Priority: Normal
----------------------------------------
Hash#partition is implemented by Enumerable so it just returns two arrays of arrays
```ruby
{1=>2,3=>4}.partition{|k,|k==1} #=> [[[1, 2]], [[3, 4]]]
```
But I think it would make more sense to behave similarly to Hash#select and Hash#reject
```ruby
{1=>2,3=>4}.partition{|k,|k==1} #=> [{1=>2}, {3=>4}]
```
--
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>