At 09:48 PM 1/5/2002 -0700, Thomas Fjellstrom wrote: >On January 5, 2002 05:23 am, you wrote: > > On Fri, Jan 04, 2002 at 11:00:45PM -0500, Jeff G wrote: > > > new P0,PerlHash > > > set P0,-6,"foo" # Store the value -6 in key 'foo' of the hash P0 > > > set I0,P0,"foo" # Recover the value at "foo" > > > > Very, very, cool. However, I'm not convinced that we're going about this > > the right way. > > > > Currently, we have vtable operations to retrieve a value by key where > > the key's an integer, and to retrieve a value by key where the key's > > a string. Of course, different PMC classes will have different ways > > of hashing things, so we might need a different vtable operation to > > retrieve by float, or by PMC, or ... Do you see what I'm saying? > > > > Basically, we need to retrieve by a generic key structure. > >yes.. By PMC :) wasnt there alot of talk about perl5 having 'PMC' like keys?
Yep. A key can (or should, at least) be an integer, a string, or a PMC. Ints for by-offset lookup, strings for by-name lookup, and PMCs because some things know what they should hash to or what their integer value is better than we do. Or so they think, at least, and who am I to decide otherwise? :) Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk