Front page | perl.perl6.language |
Postings from September 2005
September 24, 2005 06:11
Message ID: 20050924131116.GI24163@c4.convolution.nl
Hashes are full of convenience, and Huffman would be proud:
%hash.kv zip(%hash.keys, %hash.values)
One thing occurred to me: if hashes are worth all this, then why not
abbreviate "keys" further to "k" (as in "kv"), and "values" to "v" (as
in "kv"). This would allow us to rename "key" to "k" and "value" to "v"
too, resulting in:
%hash.kv zip(%hash.k, %hash.v)
With hashes and pairs, I don't think there could be any confusion over
the meaning of "k" and "v", just like "kv" works without explanation.
(Not having to type "alue" also makes it easier for a pair to NOT
evaluate to its value, but that's another thread.)