Front page | perl.perl6.language |
Postings from February 2005
Re: Valid hash keys?
Thread Previous
|
Thread Next
From:
Alex Burr
Date:
February 27, 2005 16:23
Subject:
Re: Valid hash keys?
Message ID:
20050228002106.GA6599@glasloc
On Sun, Feb 27, 2005 at 11:57:30PM +0100, Thomas Sandlaß wrote:
> Alex Burr wrote:
>
> >[..] Actually, it would be useful sometimes
> >to be able to give a hash an explicit canonicalizer:
> >
> >my %msdos_files is canonicalized_by lc;
> >
> >my %fractions is canonicalized_by gcd;
>
> Shouldn't that be handled by container subclasses of Hash?
> Like PersitentScalar or SparseArray?
Possibly. Clearly that's what one would do in any other language.
What I was thinking was that if hashes are going to have a
canonicalizer function *anyway*, maybe the default implementation
could be overridable with a trait (or role?). But I can't
actually claim to have followed perl6 development enough to
be able to argue that it really makes sense.
Alex
Thread Previous
|
Thread Next