Steve Peters wrote:
While looking into Perl 6 and pugs, I noticed a problem with Pairs pretty quickly. Although pairs look like a very useful data type, I could find in the "Perl 6 and Parrot Essentials" or any Apocolypse or other document
on how to get the key or value from a pair. I was thinking .key and .value seemed logical (and Autrojus implemented them in pugs faster than I could
even spit out the names), but that doesn't make them "official".
They're official. See Exegesis 3:
A parameter by any other name
...
In Perl 6, C<< => >> is a fully-fledged anonymous object constructor -- like C<[...]> and C<{...}>. The objects it constructs are called "pairs" and they consist of a key (the left operand of the C<< => >>), and a value (the right operand). The key is still stringified if it's a valid identifier, but both the key and the value can be any kind of Perl data structure. They are accessed via the pair object's C<key> and C<value> methods...
Damian