develooper Front page | perl.perl6.users | Postings from April 2020

Re: regex objects as hash keys

Thread Previous
From:
Joseph Brenner
Date:
April 6, 2020 16:20
Subject:
Re: regex objects as hash keys
Message ID:
CAFfgvXXtV7wXW46vaGexJqmBHFr+ry866oE-7+1WvqZKk4c3-g@mail.gmail.com
> Object hashes currently come with a performance penalty.  That's why they are currently not the default.

Thanks, that makes sense.


On 4/6/20, Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
>> On 6 Apr 2020, at 07:19, Joseph Brenner <doomvox@gmail.com> wrote:
>>> If you want a Hash which allows any
>> kind of object as key, you have to declare it such:
>>
>>>  my $obj = Rutabaga.new;
>>> my %vegeout{Any};  # <-- see:
>>> https://docs.raku.org/language/hashmap#Non-string_keys_(object_hash)
>>
>> That's an interesting detail, I didn't get that that behavior wasn't
>> the default.
>
> Object hashes currently come with a performance penalty.  That's why they
> are currently not the default.

Thread Previous


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