[#78949] [Ruby trunk Feature#13095] [PATCH] io.c (rb_f_syscall): remove deprecation notice — kosaki.motohiro@...
Issue #13095 has been updated by Motohiro KOSAKI.
3 messages
2017/01/03
[#78997] [Ruby trunk Bug#13110] Byte-based operations for String — shugo@...
Issue #13110 has been updated by Shugo Maeda.
3 messages
2017/01/06
[#79228] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150] — Eric Wong <normalperson@...>
naruse@ruby-lang.org wrote:
5 messages
2017/01/23
[#79511] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Eric Wong <normalperson@...>
2017/02/13
Eric Wong <normalperson@yhbt.net> wrote:
[#79518] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Nobuyoshi Nakada <nobu@...>
2017/02/13
On 2017/02/13 10:04, Eric Wong wrote:
[#79298] [Ruby trunk Bug#13085][Assigned] io.c io_fwrite creates garbage — nobu@...
Issue #13085 has been updated by Nobuyoshi Nakada.
3 messages
2017/01/29
[#79337] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write — SASADA Koichi <ko1@...>
Eric:
4 messages
2017/01/31
[#79352] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write
— Eric Wong <normalperson@...>
2017/01/31
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:79087] [Ruby trunk Bug#12970] == Equality of recursive sets fails
From:
p.szmielew@...
Date:
2017-01-16 09:48:31 UTC
List:
ruby-core #79087
Issue #12970 has been updated by Piotr Szmielew.
Also documentation at top of file says:
~~~ ruby
# * Set assumes that the identity of each element does not change
# while it is stored. Modifying an element of a set will render the
# set to an unreliable state.
~~~
creating recursive sets definitely change element while it is stored. So I believe this is not really a bug, simply unexpected behaviour that actually is quite consistent with documentation.
Marc-Andre Lafortune wrote:
> Piotr Szmielew wrote:
> > In this particular example even manually rehashing internal hash doesn't quite work...
>
> Right, looks like hash lookup (internally `st_lookup`) doesn't work with recursive values :-(
>
> > There is another solution - when comparing sets, use hash method calculate hashes and compare them. Code would look like this:
>
> Comparing hashes is not sufficient for equality. You can have collisions, in particular recursive structures have the same hash... Moreover that code would be too slow to be acceptable.
>
> I'm afraid there is not enough use for recursive `Set`s to have figure out a solution...
----------------------------------------
Bug #12970: == Equality of recursive sets fails
https://bugs.ruby-lang.org/issues/12970#change-62492
* Author: Kevin de Berk
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.2.5, 2.3.3
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Comparing recursive arrays and hashes with equal? contents (save for the recursive element) using == succeeds.
However, using == to compare two recursive sets with equal? contents fails. I expect that to succeed.
See the attached script. This is my output for 2.2.5 and 2.3.3:
~~~
[1, 2, 3] == [1, 2, 3]? -> true
[1, 2, 3, [...]] == [1, 2, 3, [...]]? -> true
{:a=>1, :b=>2} == {:a=>1, :b=>2}? -> true
{:a=>1, :b=>2, :c=>{...}} == {:a=>1, :b=>2, :c=>{...}}? -> true
#<Set:0x00000001f90fc8> == #<Set:0x00000001f90500>? -> true
#<Set:0x00000001f92968> == #<Set:0x00000001f91478>? -> false
~~~
---Files--------------------------------
recursive_set_comparison.rb (871 Bytes)
fix_recursive_sets.patch (2.39 KB)
--
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>