I've partially implemented the @cython.callspec("something") stuff. It
actually solves my particular needs, but it not all the possible
needs. The problem is that the calling convention spec is part of the
type of the function, and a general solution should handle the code
below:

@cython.callspec("something")
cdef void myfunc(): pass

@cython.callspec("something")
cdef void (*p)()

p = myfunc

But then the decoration on the function pointer "p" IMHO deviates too
much for the normal Python meaning of decorators...


The only possibility I can imagine up to now is something like:

cdef void callspec("something") myfunc(): pass

cdef void (callspec("something") *p)()

p = myfunc


Of course, this approach requires modification to the parser, and the
syntax could be controversial. However, the addition of callspec() as
a declarator modifier (like inline or extern) taking a single arg
would remove all the ambiguities of my original proposal of using a
bare string literal...

What do you think? We could even use a more obfuscated
__callspec("something") ...



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