toki doki, 05.07.2010 12:13:
> On Mon, Jul 5, 2010 at 6:15 PM, Stefan Behnel wrote:
>> Dag Sverre Seljebotn, 05.07.2010 10:56:
>>> the example toki doki posted gets ugly, as one needs to do
>>>
>>> foo = vect.at(4)[0] + 10
>>>
>>> to get the equivalent of the C++ "foo = vect.at(4) + 10".
>>
>> What's so ugly about that?
>>
>> Stefan
>> _______________________________________________
>
> Well, I was just concerned that many users might unintentionnally
> write " foo=vect.at(4)+10 " when they meant " foo=vect.at(4)[0]+10 ".
> If foo is declared to be an unsigned int or a pointer, there might not
> be any warning from the compiler. And that could result in a bug very
> difficult to understand.

No. You need a cast to convert a pointer to an int. So the above will fail 
if foo is declared as an int.

It may not fail if foo is undeclared and inferred as a pointer, though, but 
in that case, there will likely be other things that fail later on.

Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to