develooper Front page | perl.perl5.porters | Postings from December 2011

Re: perl's hash randomization in the news

Thread Previous | Thread Next
From:
Zsbán Ambrus
Date:
December 31, 2011 06:32
Subject:
Re: perl's hash randomization in the news
Message ID:
CAHku1CEKknLF8CKOoApOobB5Q4XKg7X0e5yWEdqeJciQ=xCwwQ@mail.gmail.com
On Fri, Dec 30, 2011 at 10:39 PM, Reini Urban <ru@x-ray.at> wrote:
> What I remember was that the random order of keys with the new perl
> hashes caused other languages to feel superior:
> "Our hash key order is predictable and always the same"

No, I think that was after ruby has rigged their hashes to remember
the order of insertion of their elements and always iterate them in
that order.  (Thus if you put a hash constructor in your code, then
print that hash, the pairs are printed in the order they are in your
code.)  Python has later introduced the same in a module
(collections.OrderedDict), but not for the default dict class.

Ambrus

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About