On Wed, Oct 28, 2009 at 1:39 PM, Dag Sverre Seljebotn <[email protected]> wrote: > I just added http://trac.cython.org/cython_trac/ticket/441 > > Basically, > > ctypedef float myfloat; > ... > print some_myfloat * some_complex > > miscompiles as "some_myfloat" is coerced to "myfloat complex" (which, > interestingly, is a type which can't be created or used in any other way!) > > Fixing this requires some thought. > > This probably broke because (in order to fix another bug) I stepped away > from "the order something is needed in Cython decides output order in > C". I believe that was a correct decision and don't want to step back. > The proper solution is a DAG of all types and their dependencies. I > believe that is a bit heavy/destabilizing for 0.12 though. Perhaps > output all very simply typedefs (typedefs of ints and floats) first, > then complex, then the rest? > > However there's another issue: Unlike what I originally thought, it is > then possible to do e.g. > > cdef extern from "foo.h": > ctypdef double mydouble # is size correct? > > print (some_mydouble * some_complex).imag > > This can fail spectacularily as we currently rely on determining > __Pyx_c_prod vs. __Pyx_c_prodf and so on at Cythonization time. > Lisandro, did you mention efforts in this direction? >
I have not done anything in this direction, but I've already pointed out that this was likely broken... There are also issues with "z.real = r" in C++ with MSVC (liekly because complex<T>::real() is not an lvalue), I've also posted about this, no one commented. Unfortunately, I do not think I can work on these issues for 0.12 if the release is going to happen this week or the next one... -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
