Re: PMCs and how the opcode functions will work

2001-11-16 Thread Jason Gloudon
On Thu, Nov 15, 2001 at 08:18:32PM +, Simon Cozens wrote: > I'm under the impression that the signature of the add method should be > > void foo (interpreter, destination, left, right) > > Shouldn't the above be more like: > > P1->vtable->vtable_funcs[VTABLE_ADD + P2->vtable->num_t

Re: PMCs and how the opcode functions will work

2001-11-16 Thread Dave Mitchell
Simon Cozens <[EMAIL PROTECTED]> wrote: > Shouldn't the above be more like: > > P1->vtable->vtable_funcs[VTABLE_ADD + P2->vtable->num_type](i, P0, P1, P2); I'm probably overlooking something here, but why the double indirection? Shouldn't that just be P1->vtable.vtable_funcs[ ?

Re: PMCs and how the opcode functions will work

2001-11-15 Thread Simon Cozens
On Thu, Oct 18, 2001 at 12:30:29PM +0100, Simon Cozens wrote: > On Mon, Oct 08, 2001 at 06:36:32PM -0400, Dan Sugalski wrote: > > P1->vtable_funcs[VTABLE_ADD + P2->num_type](P1, P2, P0); > > Uhm, since num_type and vtable_funcs are part of the vtable > structure, that would be more like >

Re: PMCs and how the opcode functions will work

2001-10-21 Thread Jason Gloudon
On Sun, Oct 21, 2001 at 07:56:08PM +0100, Simon Cozens wrote: > On Wed, Oct 10, 2001 at 11:27:24AM +0200, Paolo Molaro wrote: > > ... and to go a step further in sanity and maintainability, I'd suggest > > using a structure with properly typed function pointers instead of an > > array: > > > > ty

Re: PMCs and how the opcode functions will work

2001-10-21 Thread Tom Hughes
In message <[EMAIL PROTECTED]> Simon Cozens <[EMAIL PROTECTED]> wrote: > I've now changed the vtable structure to reflect this, but I'd like someone > to confirm that the "variant" forms of the ops can be addressed the way I > think they can. (ie. structure->base_element + 1 to get "thi

Re: PMCs and how the opcode functions will work

2001-10-21 Thread Simon Cozens
On Wed, Oct 10, 2001 at 11:27:24AM +0200, Paolo Molaro wrote: > ... and to go a step further in sanity and maintainability, I'd suggest > using a structure with properly typed function pointers instead of an > array: > > typedef void (*parrot_pmc_add) (PMC *dest, PMC *a, PMC *b); > typedef vo

Re: PMCs and how the opcode functions will work

2001-10-21 Thread Dan Sugalski
At 02:59 PM 10/20/2001 +0100, Simon Cozens wrote: >On Mon, Oct 08, 2001 at 06:36:32PM -0400, Dan Sugalski wrote: > > num_type: 0, 1, 2, 3, 4, 5 for "same as you", native int, bigint, native > >float, bigfloat, object > > > > P1->vtable_funcs[VTABLE_ADD + P2->num_type](P1, P2, P0)

Re: PMCs and how the opcode functions will work

2001-10-21 Thread Simon Cozens
On Mon, Oct 08, 2001 at 06:36:32PM -0400, Dan Sugalski wrote: > num_type: 0, 1, 2, 3, 4, 5 for "same as you", native int, bigint, native >float, bigfloat, object > > P1->vtable_funcs[VTABLE_ADD + P2->num_type](P1, P2, P0); I don't understand the "same as you" thing; num_type is

Re: PMCs and how the opcode functions will work

2001-10-18 Thread Dan Sugalski
At 12:30 PM 10/18/2001 +0100, Simon Cozens wrote: >On Mon, Oct 08, 2001 at 06:36:32PM -0400, Dan Sugalski wrote: > > P1->vtable_funcs[VTABLE_ADD + P2->num_type](P1, P2, P0); > >Uhm, since num_type and vtable_funcs are part of the vtable >structure, that would be more like > P1->vtable->vt

Re: PMCs and how the opcode functions will work

2001-10-18 Thread Simon Cozens
On Mon, Oct 08, 2001 at 06:36:32PM -0400, Dan Sugalski wrote: > P1->vtable_funcs[VTABLE_ADD + P2->num_type](P1, P2, P0); Uhm, since num_type and vtable_funcs are part of the vtable structure, that would be more like P1->vtable->vtable_funcs[VTABLE_ADD + P2->vtable->num_type](P1, P2, P0);