On Mon, Nov 10, 2014 at 1:10 PM, Dima Pasechnik
wrote:
> On 10 November 2014 20:23, Robert Bradshaw wrote:
>> On Mon, Nov 10, 2014 at 6:25 AM, Dima Pasechnik wrote:
>>> On 2014-11-06, Robert Bradshaw wrote:
I'd like to propose a more pythonic way to declare function pointer
types, nam
On 10 November 2014 20:23, Robert Bradshaw wrote:
> On Mon, Nov 10, 2014 at 6:25 AM, Dima Pasechnik wrote:
>> On 2014-11-06, Robert Bradshaw wrote:
>>> I'd like to propose a more pythonic way to declare function pointer
>>> types, namelye
>>>
>>> type0 (*[ident])(type1, type2, type3)
>>>
>>>
On Mon, Nov 10, 2014 at 6:25 AM, Dima Pasechnik wrote:
> On 2014-11-06, Robert Bradshaw 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) -> typ
On 2014-11-06, Robert Bradshaw 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/cyth
On Sat, Nov 8, 2014 at 3:19 PM, C Blake wrote:
>>But I admit it's hard to come up with an objective measure for how
>>good a syntax is...if it's natural to you than that's great.
>
> I think those queries you mention will mostly be biased by the squeakier
> wheels being more beginning people and t
>But I admit it's hard to come up with an objective measure for how
>good a syntax is...if it's natural to you than that's great.
I think those queries you mention will mostly be biased by the squeakier
wheels being more beginning people and that's not a very good argument
or metric. I agree an o
On Fri, Nov 7, 2014 at 11:29 AM, C Blake wrote:
> Robert Bradshaw robertwb at gmail.com wrote:
>>Quick: is that a pointer to an array or 10 pointers to ints? Yes, I
>>know what it is, but the thing is without knowing C (well) it's not
>>immediately obvious what the precedence should be.
>
> If you
Robert Bradshaw robertwb at gmail.com wrote:
>Quick: is that a pointer to an array or 10 pointers to ints? Yes, I
>know what it is, but the thing is without knowing C (well) it's not
>immediately obvious what the precedence should be.
If you're gonna pick something e.g like that, it should not be
On Thu, Nov 6, 2014 at 1:35 PM, C Blake wrote:
> I think you should just use the C declarator syntax. Cython already
> allows you to say "cdef int *foo[10]".
Quick: is that a pointer to an array or 10 pointers to ints? Yes, I
know what it is, but the thing is without knowing C (well) it's not
im
Stefan Behnel schrieb am 07.11.2014 um 08:18:
> We could fix some of that by allowing
>
> cdef nogil:
> cdef char*(float x, int y) get_gil
>
> But then, that's adding yet another special case.
... except when it's already supported, which it turns out to be...
Stefan
__
1989lzhh schrieb am 07.11.2014 um 05:48:
>> 在 Nov 7, 2014,02:56,Robert Bradshaw 写道:
>> 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), float, f
I think you should just use the C declarator syntax. Cython already
allows you to say "cdef int *foo[10]". Declarators aren't bad - just
poorly taught, though I can see some saying those are the same thing.
More below. I absolutely like the declarator one the most, and the
lambda one second most
Robert Bradshaw wrote:
If you want a hint, the last is something that returns numerical
integration algorithm given a string name. Yes, you could use
typedefs, but you shouldn't have to.
I don't find *any* of those particularly easy to read in the third
case, or even the second. Using typedefs
On Thu, Nov 6, 2014 at 11:56 AM, Stefan Behnel wrote:
> Robert Bradshaw schrieb am 06.11.2014 um 19:56:
>> On Thu, Nov 6, 2014 at 9:59 AM, Stefan Behnel wrote:
>>> Robert Bradshaw schrieb am 06.11.2014 um 18:15:
This becomes especially clear for return types, e.g.
cdef ((float -
Robert Bradshaw schrieb am 06.11.2014 um 19:56:
> On Thu, Nov 6, 2014 at 9:59 AM, Stefan Behnel wrote:
>> Robert Bradshaw schrieb am 06.11.2014 um 18:15:
>>> This becomes especially clear for return types, e.g.
>>>
>>> cdef ((float -> float, float, float) -> float)
>>> get_integrator(char* algo
[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), f
Robert Bradshaw schrieb am 06.11.2014 um 18:15:
> On Thu, Nov 6, 2014 at 12:29 AM, Stefan Behnel wrote:
>> Robert Bradshaw schrieb am 06.11.2014 um 08:34:
>>> I'd like to propose a more pythonic way to declare function pointer
>>> types, namelye
>>>
>>> type0 (*[ident])(type1, type2, type3)
>>>
On Thu, Nov 6, 2014 at 12:29 AM, Stefan Behnel wrote:
> Robert Bradshaw schrieb am 06.11.2014 um 08:34:
>> 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
Robert Bradshaw schrieb am 06.11.2014 um 08:34:
> 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]
Not convinced. Looks quite magic, very dif
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?
- Robert
___
20 matches
Mail list logo