develooper Front page | perl.perl6.users | Postings from September 2017

Re: Any way to get hashes to loop in order?

Thread Previous | Thread Next
From:
Brandon Allbery
Date:
September 30, 2017 21:10
Subject:
Re: Any way to get hashes to loop in order?
Message ID:
CAKFCL4XaOy8aBMbW0Lz6b4N31MjwkFZk82RZVVCoiQA6Vq1zmQ@mail.gmail.com
On Sat, Sep 30, 2017 at 5:00 PM, ToddAndMargo <ToddAndMargo@zoho.com> wrote:

> On 09/29/2017 07:25 PM, Brandon Allbery wrote:
>
>> The point of a hash is that it computes hash values from its keys for
>> fast lookup,
>>
>
> Not me.  I use them to "organize" data all in one easy to look
> up place.  For example:
>

I am talking about data structures, not personal preferences. If you want
different behavior, use the appropriate data structure: a tree instead of a
hash. Unfortunately, Perl 6 doesn't currently have any tree data structures
in its core. There is a Map, which is what some other languages call their
tree-based structures, but in Perl 6 it's an immutable hash structure
instead.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

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