Robert Bradshaw wrote:
> On Apr 25, 2009, at 2:59 AM, Dag Sverre Seljebotn wrote:
>
>> Robert Bradshaw wrote:
>>>
>>> Perhaps I'm taking a too simplistic view of things, but it seems that
>>> all we have to do is figure out whether or not we can pass a given
>>> operator onto the C++ code, which is much easier to reason about.
>>> Also, because in Python assignment is not an expression, we don't
>>> have to worry about its return value.
>>
>> Hmm. That's a nice perspective to have; but I don't think it is
>> "obvious" and leads to some fairly concrete consequences IMO:
>> Operators
>> must be declared using the Python operator syntax.
>
> I'm not so sure about this, I think using declaring the C++ operatorX
> notation may be more transparent to what is actually going on,
> despite a (minor) complication in the parser.

I think maintaining a hybrid solution using C++ syntax but different
semantics (i.e. Cython semantic) is bound to give lots of confusion. I'd
have no idea what a natural syntax would be personally; we would invent
something new which just looked like C++.

How would you represent my latter example in my previous mail at using C++
syntax in Cython?

>> So you are never
>> declaring anything about "operator[]" in Cython, instead you are
>> declaring "what types are allowed for the full statement 'x[i] = y'".
>
> Yes, I think that's as far as we need to go.

This is what I think conflicts with letting the operator[] notation into
Cython. operator[] means nothing of the sort of what we are really
supporting.

C++ is a very complicated language and it's semantics differ a lot from
Cython. Which is why I'm afraid that using C++ syntax in Cython will be
confusing.

Dag Sverre

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

Reply via email to