i.e., is Ruby's Set equivalent to Java's LinkedHashSet?
相关问题
- How to specify memcache server to Rack::Session::M
- Why am I getting a “C compiler cannot create execu
- reference to a method?
- ruby 1.9 wrong file encoding on windows
- gem cleanup shows error: Unable to uninstall bundl
相关文章
- C#中 public virtual string Category { get; }这么写会报错:
- Ruby using wrong version of openssl
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- “No explicit conversion of Symbol into String” for
- Segmentation fault with ruby 2.0.0p247 leading to
- How to detect if an element exists in Watir
- uninitialized constant Mysql2::Client::SECURE_CONN
In Ruby 1.9: yes. In Ruby 1.8: probably not.
Set
uses aHash
internally; and since hashes are insertion-ordered in 1.9, you're good to go!As mu is too short points out, this is an implementation detail and could change in the future (though unlikely). Thankfully, the current implementation of
Set
is pure ruby, and could be adapted into anOrderedSet
in the future if you like