At 12:16 PM +0200 8/31/04, Leopold Toetsch wrote:
Dan Sugalski <[EMAIL PROTECTED]> wrote:

 Add a vtable slot to the PMC vtable inv_init (or something like that,
 the name's not that big a deal),

vtable->new and "__new"?

Those are a little too similarly named. We should have something more distinct, I think.


> ... define it as an invokable method
 taking parameters as the current calling conventions, and be done
 with it. Basically we special-case this one method and hoist it up
 into a vtable slot. IMCC for it'd look something like:

(result1, result2) = $Pxxx.inv_init(1, 2, "foo", "bar", $Pbaz)

Two return values? What is $Pxxx: a class PMC or an empty Undef object of some kind?

$Pxxx is an uninitialized object of the class you're creating, but that won't work at the PIR level. PIR combines the new and init functions together, which I always forget.


I think we should have:

   Pclass = getclass, "Foo"
   Pobjnew = Pclass."__new"(args)  # Pnew is an OUT argument

and that be special-cased to call VTABLE_new according to calling
conventions.

Still don't like __new, but otherwise that works out OK. It'd call VTABLE_init_extended or whatever we'd name the entry.


How does that correspond to the proposed CONSTRUCT property? Is that
still needed?

I don't think CONSTRUCT would be needed with this. -- Dan

--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to