The C<new_extended> opcode and vtable is in CVS. The Complex PMC has a reference implementation (modulo some error checking[1]) and there are some tests using the new opcode as well as the function call syntax.

I'd be glad if people could implement the C<new_extended> vtable method for other PMCs too.

Some PMCs have a similar constructur (C<invoke>), which is used for creating Python objects. This method takes PMC areguments only, but is rather similar. When the C<new_extended> slots are filled, its likely that C<invoke> can be removed then. That needs some work in the compiler though, to detect that the function call is actually the object instantiation.

Thanks,
leo

[1] Python throws a TypeError exception. E.g.

>>> i = int(1,2,3)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: int() takes at most 2 arguments (3 given)
>>>

I think, we could use that as well generically. classes/fixedpmcarray and some others have it implemented in invoke()



Reply via email to