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