On Sat, 2004-01-24 at 06:18, Leopold Toetsch wrote: > Either: > new $P2, .HashlikeStruct, $P1 > or > assign $P2, $P1
That gave me "Illegal initializer for struct", which may be related to your next comment. > > pmclass HashlikeStruct extends UnManagedStruct need_ext does hash > > I'd not put that in a new PMC class. ManagedStruct inherits from > UnmanagedStruct - it wouldn't be able to use that functionality. > > If you make the initializer an OrderedHash, you can access struct > elements by integer or string key. You would only need a test in > char_offset_key, if you have an integer or string key. Can you explain that in a little more detail? Assume I'm a lurker (for their benefit, of course, not that I'm fumbling in the dark here). Would you create a new PMC? What would you extend? Which vtable methods would you override? Would you use the technique Dan suggested of keeping a mapping of string key to offset hanging off the cache.pmc_key pointer? If not, what would you do? Basically, I'm either going to run off and do exactly what someone suggests or keep stumbling around until I find something that works in one or two limited tests and then bring it back to the list when it breaks or doesn't work quite right. Here's everyone's chance to point me in a good direction now, in one shot, instead of in several fits and false starts over the next couple of weeks. :) -- c