in reply to What makes an array sorted and a hash unsorted?
Hash values are often reordered when more buckets are allocated and so forth, right?
Caution: Contents may have been coded under pressure.
I would say the thing that makes arrays sorted is that you can say @arrayname to get the values, and they'll be in a consistent order. If you say values %hash to get the values of a hash, they will be in no particular order.
Arrays have push and pop and shift and unshift that take advantage of the order of the array. for iterates through arrays in known order; each iterates through hashes. I think not merely our usage, but the language's design, says that arrays are ordered and hashes are unordered.
Caution: Contents may have been coded under pressure.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What makes an array sorted and a hash unsorted?
by ikegami (Patriarch) on Jun 01, 2009 at 17:35 UTC | |
by Roy Johnson (Monsignor) on Jun 01, 2009 at 17:45 UTC | |
by ikegami (Patriarch) on Jun 01, 2009 at 17:54 UTC | |
by Roy Johnson (Monsignor) on Jun 01, 2009 at 18:07 UTC | |
by ikegami (Patriarch) on Jun 01, 2009 at 18:12 UTC | |
|
In Section
Meditations