[#84867] [Ruby trunk Bug#14357] thread_safe tests suite segfaults — v.ondruch@...

Issue #14357 has been reported by vo.x (Vit Ondruch).

11 messages 2018/01/15

[#84980] [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — hsbt@...

Issue #13618 has been updated by hsbt (Hiroshi SHIBATA).

10 messages 2018/01/23
[#85012] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — Eric Wong <normalperson@...> 2018/01/23

hsbt@ruby-lang.org wrote:

[ruby-core:84680] [Ruby trunk Bug#14069] Document order of elements in Set

From: Ruby-Lang@...
Date: 2018-01-07 01:55:42 UTC
List: ruby-core #84680
Issue #14069 has been updated by jwmittag (J旦rg W Mittag).


*Is* that actually guaranteed by the specification? Can you point to any specification or documentation or official statement by the core team that supports your assertion that sets are insertion-ordered?

----------------------------------------
Bug #14069: Document order of elements in Set
https://bugs.ruby-lang.org/issues/14069#change-69394

* Author: abotalov (Andrei Botalov)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.4
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Hash enumerates values in the insertion order.

Set is built on Hash so it does the same.
However, this is currently believed to be a not documented implementation detail. See:
https://stackoverflow.com/a/14468621/841064
https://stackoverflow.com/questions/10361250/does-set-in-ruby-always-preserve-insertion-order#comment13351258_10361275
https://spin.atomicobject.com/2012/09/04/when-is-a-set-better-than-an-array-in-ruby/

I think it would be better to explicitly document that Set class enumerates keys in the insertion order.



-- 
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>

In This Thread

Prev Next