Joe Gottman writes:

>       sort {$_.key} (1=> 'a', 10 => 'b', 2 =>'c');
> 
> There is nothing in the signature of the key-extractor to suggest that
> all the keys are numbers, but as it turns out they all are.

Are they?  I'd been presuming that pair keys would always be strings (as
for hashes in Perl 5), and that the C<< => >> operator would
automatically quote a preceding word, stringifying it (as in Perl 5).
So the keys above are strings, albeit ones composed only of digits.

Of course that doesn't actually help with your question, since there are
other data structures of which the same could be asked.

Smylers

Reply via email to