[#85940] [Ruby trunk Bug#14578] Forking a child process inside of a mutex crashes the ruby interpreter — ben.govero@...
Issue #14578 has been reported by bengovero (Ben Govero).
3 messages
2018/03/05
[#86205] [Ruby trunk Feature#14618] Add display width method to String for CLI — aycabta@...
Issue #14618 has been reported by aycabta (aycabta .).
3 messages
2018/03/19
[#86366] Re: [ruby-cvs:70102] usa:r63008 (trunk): get rid of test error/failure on Windows introduced at r62955 — Eric Wong <normalperson@...>
usa@ruby-lang.org wrote:
3 messages
2018/03/28
[ruby-core:86295] [Ruby trunk Bug#14263] Array Intersection does not seem to use hash
From:
styrmis@...
Date:
2018-03-25 21:41:15 UTC
List:
ruby-core #86295
Issue #14263 has been updated by styrmis (Stefan Magnuson).
File array-eql-by-hash.patch added
File object-eql-documentation-tweak.patch added
Attached are two patches:
- One which uses hash comparison for both the optimised "small" array branch and the default implementation of the `Array` set operations (essentially restoring the behaviour of Ruby < 2.5)
- Another which adds a warning to the documentation for `Array#eql?`, stating that the link between hash equality and `eql?` must not be broken in subclasses
As the behaviour being relied upon in Ruby < 2.5 is not well defined (`#eql?` has been modified to not take the hashes of compared objects into account), then perhaps updating the documentation is the better approach.
If backwards compatibility of the (undefined) behaviour is to be maintained, then I believe the patch to `Array` achieves this, though is perhaps of limited value.
All feedback is of course very welcome!
----------------------------------------
Bug #14263: Array Intersection does not seem to use hash
https://bugs.ruby-lang.org/issues/14263#change-71212
* Author: gkellogg (Gregg Kellogg)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.5.0
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
According to the documentation for Array#&, comparison is done using hash and eql? However, this does not seem to be the case in 2.5.0.
If two instances are .eql? but their hashes are not, an array & should be empty:
~~~ ruby
([Var.new('a')] & [Var.new('b')]).empty?
~~~
This test works in 2.4.2 (and all earlier versions), but fails in 2.5.0. See attached script.
---Files--------------------------------
array_intersection.rb (535 Bytes)
test-14264.rb (956 Bytes)
array-eql-by-hash.patch (2.09 KB)
object-eql-documentation-tweak.patch (825 Bytes)
--
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>