William Coleda <[EMAIL PROTECTED]> wrote: > So, this divides anything that provides an array like interface into > two camps - those that support the push opcode, and those that don't. > This means that whenever you write code that needs to be PMC agnostic > (for example, any of the list processing commands in Tcl - after all, > the could be called by someone elses languages, and I don't know if > their arrays are resizeable), you have to avoid using push when > implementing the code. Or, handle the exception and the fallback to a > non push method of doing it (which seems like even /more/ work.)
Well basically yes. But the "PMC agnostic" part isn't quite true. You can't push onto an Integer PMC, nor onto an Hash. And you can't push aka .append onto a Python tuple. The same problem arises for a lot of other vtable methods like get_number, which is implemented for scalars only. > If nothing else, this should probably be documented in stronger > language in ops/pmc.ops. As said, the implemented vtable method depend on the PMC. Looking into the documentation of that PMC should give you a list of all vtables. $ perldoc -F classes/fixedpmcarray.pmc leo