[#90865] [Ruby trunk Bug#15499] Breaking behavior on ruby 2.6: rb_thread_call_without_gvl doesn't invoke unblock_function when used on the main thread — apolcyn@...
Issue #15499 has been reported by apolcyn (alex polcyn).
3 messages
2019/01/03
[#90877] [Ruby trunk Bug#15499] Breaking behavior on ruby 2.6: rb_thread_call_without_gvl doesn't invoke unblock_function when used on the main thread — apolcyn@...
Issue #15499 has been updated by apolcyn (alex polcyn).
3 messages
2019/01/03
[#90895] Re: [ruby-alerts:11680] failure alert on trunk-mjit@silicon-docker (NG (r66707)) — Eric Wong <normalperson@...>
ko1c-failure@atdot.net wrote:
4 messages
2019/01/05
[#90896] Re: [ruby-alerts:11680] failure alert on trunk-mjit@silicon-docker (NG (r66707))
— Takashi Kokubun <takashikkbn@...>
2019/01/05
Thanks to explain that.
[#91200] [Ruby trunk Feature#15553] Addrinfo.getaddrinfo supports timeout — glass.saga@...
Issue #15553 has been reported by Glass_saga (Masaki Matsushita).
4 messages
2019/01/21
[#91289] Re: [Ruby trunk Feature#15553] Addrinfo.getaddrinfo supports timeout
— Eric Wong <normalperson@...>
2019/01/26
glass.saga@gmail.com wrote:
[ruby-core:91252] [Ruby trunk Feature#11076] Enumerable method count_by
From:
mame@...
Date:
2019-01-24 14:21:12 UTC
List:
ruby-core #91252
Issue #11076 has been updated by mame (Yusuke Endoh).
I have learnt the word "tally" in this thread. Thank you. It looks good to me, a non-native speaker. I have put this on the agenda of the next developers' meeting.
By the way, what is the precise semantics of the method?
Question 1. What identity is the object in the keys?
```
str1 = "a"
str2 = "a"
t = [str1, str2].tally
p t #=> { "a" => 2 }
p t.keys.first.object_id #=> str1.object_id or str2.object_id ?
```
IMO: I think it should prefer the first element, so it should be equal to `str1.object_id`.
Question 2. What is the key of `tally_by`?
```
str1 = "a"
str2 = "A"
t = [str1, str2].tally_by(&:upcase)
p t #=> { "a" => 2 } or { "A" => 2 } ?
p t.keys.first.object_id #=> str1.object_id, str2.object_id, or otherwise?
```
IMO: The return values of `sort_by` and `max_by` contains the original elements, not the return value of the block. According to the analogy to them, I think that `t` should be `{ "a" => 2 }` and its key be `str1.object_id`.
----------------------------------------
Feature #11076: Enumerable method count_by
https://bugs.ruby-lang.org/issues/11076#change-76498
* Author: haraldb (Harald B旦ttiger)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
I very often use `Hash[array.group_by{|x|x}.map{|x,y|[x,y.size]}]`.
Would be nice with to have a method called `count_by`:
~~~ruby
array = ['aa', 'aA', 'bb', 'cc']
p array.count_by(&:downcase) #=> {'aa'=>2,'bb'=>1,'cc'=>1}
~~~
--
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>