[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
Issue #12134 has been updated by Martin D端rst.
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74169] [Ruby trunk Bug#12145] Aliashood between `size` and `length` is not consistent
From:
sawadatsuyoshi@...
Date:
2016-03-05 19:18:55 UTC
List:
ruby-core #74169
Issue #12145 has been updated by Tsuyoshi Sawada.
Similarly, `Enumerable#inject` and `Enumerable#reduce` and `Enumerable#map` and `Enumerable#collect` should be aliased (Although they are not particularly inconsistent, so the motivation for them is not as strong as `size` and `length`. But it is indeed strange that in RDoc, `inject` example appears under `reduce` and vice versa, etc.).
----------------------------------------
Bug #12145: Aliashood between `size` and `length` is not consistent
https://bugs.ruby-lang.org/issues/12145#change-57312
* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v:
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
When `size` and `length` have the same implementation, depending on the class, they are either independently defined methods, or the former is an alias of the latter. Particularly for `Array`:
~~~RUBY
[].method(:size).original_name # => :length
[].method(:length).original_name # => :length
~~~
but for `Hash`, `String`, and `Symbol`:
~~~RUBY
{}.method(:size).original_name # => :size
{}.method(:length).original_name # => :length
"".method(:size).original_name # => :size
"".method(:length).original_name # => :length
:"".method(:size).original_name # => :size
:"".method(:length).original_name # => :length
~~~
This might be a big issue, but since there is a standard Ruby method `original_name`, which returns different results, whether this being one way or another should matter. And I see no reason why they should behave differently. They should be unified in one way. Perhaps `Hash`, `String`, and `Symbol` should be made in the same way as with `Array`.
--
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>