Clinton A. Pierce wrote:

While working on ...something... I found the need to be able to tell if a key exists in a PerlHash. Here's the kicker, I don't know what kind of data's gonna be there: int, float, PMC, or string.

[ snipp ]


    exists Px[key], branch

PDD02 specifies the needed methods

exists_keyed
type_keyed

perlhash/array have exists_keyed (but no type_keyed), though the opcodes are missing.


So once I can tell the key is there, that brings up the second problem: what exactly is behind that key? A PMC? A native type? The only thing I can think of that would suffice would be to tinker with typeof to make it able to recognize the PASM native types (N, I, S) and then to make it a keyed op.
We must define and standardize the enum_type_*. list.h has a bunch of them, though, when reading PDD02, the values should be negative numbers to discern these types from PMCs. hash.h has it's own types, which of course should match those in list.h

leo

Reply via email to