Leopold Toetsch wrote:
The former is also implementing the Hash iteration internals. E.g.
switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
case KEY_hash_iterator_FLAGS:
...
return parrot_hash_get_idx(INTERP, hash, key);
Yeah, that part's pretty horrifying, but also the same between
get_string_keyed and get_pmc_keyed, so not the cause of Jonathan's problem.
This implementation is somehow inside out and a bit weird. Earlier it was
insider the iterator, but then the iterator had to know some internals of the
hash to work, which was suboptimal too.
We'll have to untangle the two at some point. Consider it an advanced
cage cleaner task someone can tackle when they need a break from other
stuff.
The major problem is probably, that there are no specific iterator interface
vtable functions that an iterator would use.
Isn't that what nextkey_keyed is for? Though, looking at it, it seems
more like part of the problem of entanglement than part of the solution.
Allison