Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Actually, insertion order preservation is a 1.9 feature:

> Hashes enumerate their values in the order that the corresponding keys were inserted.

from http://www.ruby-doc.org/core/classes/Hash.html



The docs were wrong for a long time, but looking back at the issue, there was a quiet turnaround in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/....

So, hashes can be considered ordered in 1.9. It's a mistake to corrupt the data structure, in my opinion, but apparently that boat has now sailed. Thanks for the prod to recheck and sorry about the outdated info.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: