On Thu, Oct 3, 2013 at 3:00 PM, Stefan Behnel <stefan...@behnel.de> wrote:
> Nathaniel Smith, 03.10.2013 14:35:
>> On Thu, Oct 3, 2013 at 1:23 PM, Stefan Behnel wrote:
>>> Greg Ewing, 03.10.2013 14:10:
>>>> Robert Bradshaw wrote:
>>>>>     cdef int *a, b, c, *d[3]
>>>>>
>>>>> is IMHO quite ugly but also adds a lot of complexity to the parser.
>>>>> What if instead we required
>>>>>
>>>>>     cdef int* a
>>>>>     cdef int b, c
>>>>>     cdef int[3]* d
>>>
>>> The last line looks ambiguous, BTW, hadn't even noticed it before. Is that
>>> an array of int pointers or a pointer to an array (pointer)? We should make
>>> sure the way this is declared is really obvious and not unexpected to C 
>>> users.
>> [...]
>> The two halves of this email seem to sort of contradict each other,
>> don't you think? At least the C syntax has the advantage that it's
>> well-defined and many people *do* know it (and if they don't then
>> there are bazillions of references around, plus you can just copy it
>> out of header files if you're wrapping a C library), whereas as noted
>> above, in fact there are *no* people who know how to look at int[3]*
>> and be confident about what it means, even you...?
>
> Well, it's still better than looking at "*d[3]", now, isn't it? Maybe I'm
> just confused (by both, actually) because I'm not really breathing C.

Yeah, personally in either case I'd have to look it up (and it's
simply impossible that you're going to make it as easy to lookup this
funky Cython-specific syntax as it is to look up standard C syntax).
But also, the reason I don't know the C version already is that I've
probably never seen such a declaration in real life, which makes it
hard to see why this is a really pressing problem. I don't really come
to Cython because I want idiosyncratic tweaks to things C already does
perfectly well, you know? I come to Cython because I want a nice way
to get Python and C to talk to each other, so sticking to familiar
Python and C things is rather nice...

-n
_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to