Robert Bradshaw wrote:
> On May 6, 2009, at 1:33 PM, Dag Sverre Seljebotn wrote:
>> OTOH, if heap-allocation-and-refcounted semantics isn't selected, one
>> should use "cdef struct" instead, like Lisandro suggests.
>
> Structs are also something different (well, there's a lot of
> similarity, but the idea of inheritance is a big one), especially if
> we're looking at heap allocated classes for the first iteration. (I
> don't think we want to try to do our own refcounting, let the user
> use new and delete directly if they want to use C++.)

Well, they are not something different in C++ :-)

If you don't want to try your own refcounting, please, please tell me that
the only allowed form of usage of the class will be

cdef CppClass* obj

Allowing

cdef CppClass obj

in any form and requiring a manual delete would be very confusing and
difficult to remember.

(That's what I mean by refcounting -- I imagined the difference between
these two syntaxes would be that the latter of these would be refcounted;
and subject for automatic stack-allocation-optimization.)

Dag Sverre

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

Reply via email to