in reply to Objects as hash keys?
It is possible in Perl6.
L<S09/Hashes> states:
To declare a hash that can take any object as a key rather than just a string, say something like:
my %hash is shape(Any);
Likewise, you can limit the keys to objects of particular types:
my Fight %hash is shape(Dog;Cat);
The standard Hash is just
my Any %hash is shape(Str);
Note that any type used as a key must be intrinsically immutable, or it has to be able to make a copy that functions as an immutable key, or it has to have copy-on-write semantics. It is erroneous to change a key object’s value within the hash except by deleting it and reinserting it.