[Cython] Warning about another bug
Robert Bradshaw
robertwb at math.washington.edu
Wed Aug 6 18:35:50 CEST 2008
On Aug 6, 2008, at 9:35 AM, Dag Sverre Seljebotn wrote:
> Robert Bradshaw wrote:
>> On Aug 6, 2008, at 1:49 AM, Dag Sverre Seljebotn wrote:
>>
>>> Obviously my past efforts weren't good enough:
>>>
>>> DEF MYLEN = 3
>>> c = sizeof(MyStruct[MYLEN])
>>>
>>> So it seems that the parser can never discern the current syntax
>>> (MYLEN
>>> could have been a typedef and MyStruct and extension type, and
>>> then it
>>> would have been buffer syntax).
>>>
>>> So if keeping the current syntax, I seem to have no choice but to
>>> create
>>> a TrailingBracketTypeNode and delay the decision until type
>>> analysis.
>>> This takes some work, and adds complexity, so I want to be sure
>>> that it
>>> is needed first.
>>
>> I'm not understanding why we need to introduce a new node here, why
>> not let the sizeof operator be OK with index nodes?
>
> Yes, if you can guarantee me that the sizeof operator is the only
> place
> this happens, and that the sizeof name cannot ever be overriden and so
> on, I could do that.
>
> The thing is, I've been bitten so many times by wrong assumptions
> by now
> that I'd rather use a new rule controlling the thing: If [] is used
> on a
> pyobject, then it is buffer, on a native type, then array. But then I
> need to defer the resolution of what the [] means until type analysis
> time.
I think this makes sense.
> (Basically I need to merge the buffer and array type nodes and set
> some flags, so the number of node types are reduced.)
>
>>
>>> So, can I leave this bug in until the outcome of the syntax is more
>>> conclusive? (I'm currently gathering some response from the NumPy
>>> list
>>> and I want to see if they come up with anything...)
>>
>> Yes, as long as we don't take too long.
>
> I'll likely fix it tomorrow, if the syntax is kept (which I think it
> will be).
>
> --
> Dag Sverre
>
>
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev
More information about the Cython-dev
mailing list