On Wed, Oct 06, 2004 at 03:43:35PM +0200, Leopold Toetsch wrote: > 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.
I meant "Array PMC agnostic", of course. Dan pointed out that the Fixed PMCs are not Bounded PMCs (which for some reason I thought they were), so I'll settle for grousing to myself. =-) > 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 The documentation should end up in docs/pmc after a build. Currently only a small subset of documentation is generated.