I have some working code. If any of you have some time, I can send a
preliminary patch.

There are a lot of issues that need to be addressed, mainly:

* This new complex support should be enabled by using a complier
directive. If not, there are backward compatibility issues, now
'complex' means the native C99/C++ type, and not the Python type
object. Furthermore, what would happen if the C compiler does not
fully implement C99 (Sun?). Other way will be to also support an
implementation based on Python's "Py_complex" struct, but I have not
idea how to transform airthmetic operations in appropriate function
calls.

* Regarding the above issue, I'm not sure if we should use "complex"
or something new, like "ccomplex", I mean, how to specify the C native
type, like "cdef complex z" or "cdef ccomplex z", or something
different. The second will clearly help to dissambiguate and also
solve backward compatibility issues.

* Up to now, I'm only managing the "double complex" case, supporting
"float complex" or "long double complex" will require the introduction
of a 'precission' concept in the spirit of 'longness' for integers
(What do you think?).

Unfortunately, I'll not be available on all January to further work on
this. Just let me know if any you want to look at my patch. At least,
it serves to figure out what parts needs to be touched to make Cython
understand "complex" as a native C type.


-- 
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

Reply via email to