On 2004/9/10, [EMAIL PROTECTED] (David Green) wrote:

>If we consider a generic "data structure" type (which may or may not be 
>optimised under the hood for integral indices), then why shouldn't {} be 
>the "index-by-name" interface, and [] the "index-by-ordinal" interface? 
>(Does that mean [$x] is just a shorthand for {nth($x)}?)  

Maybe not.  You can use an object for a hash key -- it would be 
confusing if certain objects (ordinals) got treated specially.  (Don't 
ask me why you'd want to use an ordinal as a hash name anyway....)



Alice could only look puzzled: she was thinking of bidirectional 
iterators.

"You are ambivalent," the Knight said in an anxious tone: "let me recite 
a poem to comfort you."

"Does it take many keystrokes?" Alice asked, for she had heard a good 
deal of Perl poetry.

"It's long," said the Knight, "but above par. Everybody that hears it -- 
either it brings the tears into their eyes, xor-- ' 

"Xor what?" said Alice, as the Knight had paused for a bit.

"Xor it doesn't, you know. I call it my %hashdock{5th}."

"Oh, it's the fifth element, is it?" Alice said, trying to keep on-topic.

"No, you don't understand," the Knight said, looking a little vexed.  
"That's just what it's *called*.  It really is the third one."

"Well, what *is* the poem, then?" said Alice, who by this time was 
completely bewildered.

"I was coming to that," replied the Knight.  "The poem really is 
SCALAR(0x809e94), and the implementation's my own class."

Alice felt her migraine coming back and wished she had paid more 
attention when her sister tried to teach her Python.



                      -David "yes, that's MUCH less confusing!!" Green

Reply via email to