James Edward Gray II wrote: > On Friday, June 6, 2003, at 03:32 AM, R. Joseph Newton wrote: > > > The player's name IS the number. No other numbering system is > > needed. The players name is NEVER stored in the hash, AFAIK. The > > name is used to feed a hashing function, which renders an index into > > the storage of the hash structure. There is found the count-- the > > ONLY DATA stored for any player/number., > > Well, I think we got Stuart sorted out a few days ago, but since you > bring it up I prefer to think of a hashes as stored pairs, no matter > what they really are. You could be right about the key not being > stored, I honestly have no clue. Things like keys() and each() have to > get it from somewhere though (Reversing the hashing operation? Again, > no clue.) and since they do exist, it's easier for me to think of them > as a key and value pair being stored. Of course, this is all just > opinion and I'm sure other programmers have different views from either > of us.
To simplify somewhat, the key string is massaged into a numeric value called the 'hash value'. This value determines where in the internal structure the data element is stored. Each entry consists of three items: the hash element's key string and value, and the computed 'hash value'. To locate an element from a given hash key, the 'hash value' is calculated, and the area of storage which this indicates is searched for an entry with a matching key string. In short: yes, the hash element does keep a copy of the key string internally. HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]