Dan Sugalski <d...@sidhe.org> wrote: > ... And... we > move *all* the operator functions out of the vtable and into the MMD > system. All of it.
This *all* includes vtable functions like add_int() or add_float() too, I presume. For these we have left argument dispatch only. But what is the right argument? A PerlInt, TclInt, PyInt (or ..Float)? Or is it assumed to be the same as the left argument type?
Dan Sugalski <d...@sidhe.org> wrote: > ... We rework the current pmc > processor to take the entries that are getting tossed and > automatically add them to the MMD tables on PMC load instead.
I've now implemented MMD for PerlInt's bitwise_xor as a test case. Syntax looks like this:
Leopold Toetsch <l...@toetsch.at> wrote: > Dan Sugalski <d...@sidhe.org> wrote: >> ... And... we >> move *all* the operator functions out of the vtable and into the MMD >> system. All of it. > This *all* includes vtable functions like add_int() or add_float() too, > I presume. For these we have left argument dispatch only. But what is > the right argument? A PerlInt, TclInt, PyInt (or ..Float)? Or is it > assumed to be the same as the left argument type?
>Leopold Toetsch <l...@toetsch.at> wrote: >> Dan Sugalski <d...@sidhe.org> wrote:
>>> ... And... we >>> move *all* the operator functions out of the vtable and into the MMD >>> system. All of it.
>> This *all* includes vtable functions like add_int() or add_float() too, >> I presume. For these we have left argument dispatch only. But what is >> the right argument? A PerlInt, TclInt, PyInt (or ..Float)? Or is it > > assumed to be the same as the left argument type?
The three options are promotion to PMC, leaving these in the vtable, or having a mmd-variant for them.
I'm up for the mmd-variant version. We just have a one-dimensional table for PMC/int, PMC/float, and PMC/string functions and have the ops directly dispatch to it. Seems simpler than stuffing the functions into the base MMD table too. -- Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai d...@sidhe.org have teddy bears and even teddy bears get drunk
Dan Sugalski <d...@sidhe.org> wrote: > I'm up for the mmd-variant version. We just have a one-dimensional > table for PMC/int, PMC/float, and PMC/string functions and have the > ops directly dispatch to it. Seems simpler than stuffing the > functions into the base MMD table too.
We currently have left type only dispatch as a default for a non-existent right type, this is in type slot 0.
What about this: - assign fix class enums (we need that anyway for PBC consistency) - assign class enums 1..3 to utility PMCs like Env that don't do MMD - use these 3 type slots in the one and only MMD table for int, float, string
>> I'm up for the mmd-variant version. We just have a one-dimensional >> table for PMC/int, PMC/float, and PMC/string functions and have the >> ops directly dispatch to it. Seems simpler than stuffing the >> functions into the base MMD table too.
>We currently have left type only dispatch as a default for a >non-existent right type, this is in type slot 0.
>What about this: >- assign fix class enums (we need that anyway for PBC consistency) >- assign class enums 1..3 to utility PMCs like Env that don't do MMD >- use these 3 type slots in the one and only MMD table for int, float, > string
I'm mildly hesitant to have three special columns in the table (and I'm not 100% sure someone won't do something really bizarre with Env) but this seems OK. The one downside to it is that it potentially anchors the rows a bit more than we might otherwise want--it's possible to save a lot of space if each row in the MMD table has a starting number and length prepended, so that the row for type 87 would be 5 words long if it only had entries for types 66, 67, and 68. (That paper I posted a link to a while back describes some of this stuff)
OTOH that's all implementation detail, so lets go ahead and do it. -- Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai d...@sidhe.org have teddy bears and even teddy bears get drunk
> - assign class enums 1..3 to utility PMCs like Env that don't do MMD > - use these 3 type slots in the one and only MMD table for int, float, > string
We have to extend the function range of the table. Using type slots for functions is just nonsense.