At 8:42 AM +0200 7/1/04, Leopold Toetsch wrote:
Dan Sugalski <[EMAIL PROTECTED]> wrote:

And I'm now thinking that we want to do mmd for assignment. Dammit. :(

Don't think so. We need, ehem, probably, set_complex, get_complex and so on vtables. Complex is a basic type like integer, number, or bignum.

Probably. More a set_imaginary than set_compex, though. I don't think that's needed as such for the benchmark, though. (And should it take a BIGNUM or a NUMVAL?)


def main():
        i = complex(2 + 1j)
        print i

dis(im.main)
  2           0 LOAD_GLOBAL              0 (complex)
              3 LOAD_CONST               1 (2)
              6 LOAD_CONST               2 (1j)
              9 BINARY_ADD
             10 CALL_FUNCTION            1

MMD does the math then automatically, if the proper slots are filled.

Yeah. In this case, if the 1j constant is a PMC, it ought be a Complex PMC (or an Imaginary one) and then MMD should work out fine without needing slots.


Happily, the tests don't use complex very often. It's just:

,--[ The Pie-thon README.txt ]-----------------------------------------
| The benchmark here is intended to make Dan Sugalski's life difficult:
`----------------------------------------------------------------------

Ah, yeah, that's Guido--ever thoughtful. :) -- Dan

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

Reply via email to