[Cython] New function (pointer) syntax.

Dima Pasechnik dimpase at gmail.com
Mon Nov 10 15:25:10 CET 2014


On 2014-11-06, Robert Bradshaw <robertwb at gmail.com> wrote:
> I'd like to propose a more pythonic way to declare function pointer
> types, namelye
>
>     type0 (*[ident])(type1, type2, type3)
>
> would instead become
>
>     (type1, type2, type3) -> type0 [ident]
>
> I have a pull request up at https://github.com/cython/cython/pull/333;
> what do people think?

we had a discussion with Volker about this few weeks ago - in my Cython code I
needed to do, as he suggested, a workaround like this:
 
   int* vlamatrix  "(int (*)[])" (int*) # a hack to get int (*)[] through cython

This was for 2-dim arrays of variable length, and looks similar to the 
stuff here.

IMHO it would be good to address this, too.
I'd rather stick to C99 conventions in Cython.
To me, using '->' for types looks way too close to what is used, with  
different semantics,  in functional languages like Haskell or Coq.


Dima



More information about the cython-devel mailing list