[sage-devel] Re: [Cython] New function (pointer) syntax.

2014-11-06 Thread Robert Bradshaw
[Cc'ing elsewhere for more feedback. Also top-posting for initial impressions before the discussion.] Here's some proposed function pointer syntaxes; which are the most obvious to understand/read/remember? Can you figure them out? cdef float (*F)(float) cdef float (*G)(float (*)(float),

[sage-devel] Re: [Cython] New function (pointer) syntax.

2014-11-06 Thread Nils Bruin
On Thursday, November 6, 2014 10:57:23 AM UTC-8, Robert Bradshaw wrote: cdef float - float F cdef (float - float, float, float) - float G cdef (char*) - (float - float, float, float) - float H Is there any precedent for an infix operator in type declarations? I find it

[sage-devel] Re: [Cython] New function (pointer) syntax.

2014-11-06 Thread Travis Scrimshaw
Here's my 2 cents. cdef float (*F)(float) cdef float (*G)(float (*)(float), float, float) cdef float ((*H)(char*))(float (*)(float), float, float) I prefer this one because it mimics C function pointers (at least how I remember, I'm somewhat rusty). When I saw the -, I

[sage-devel] Re: [Cython] New function (pointer) syntax.

2014-11-06 Thread Nathann Cohen
Hello ! To me the second looks the most clear. Except that I would have written cdef (char*) - ((float - float, float, float) - float H) instead of cdef (char*) - (float - float, float, float) - float H But well, one gets used to things like that. It is clearer but indeed is it surprising

Re: [sage-devel] Re: [Cython] New function (pointer) syntax.

2014-11-06 Thread Robert Bradshaw
Thanks for all the feedback! On Thu, Nov 6, 2014 at 7:13 PM, Travis Scrimshaw tsc...@ucdavis.edu wrote: Here's my 2 cents. cdef float (*F)(float) cdef float (*G)(float (*)(float), float, float) cdef float ((*H)(char*))(float (*)(float), float, float) I prefer this one