Thursday, July 2, 2009

new and del operators working!

Now we can instanciate C++ objects dynamically on Cython.
thins like
cdef Foo *aFoo = new Foo()
del aFoo
are allowed.
We're using Python Syntax for it, so, we define the contructor with "__init__" special method.
Now, the next step is to work with function overloading. We already have the logic to implement it. So, what I need now is to work :).
But, before it, I shall write some tests and some documentation, and my branch of GSoC will be merged to the main branch of Cython, and so, let users do what is needed.

Wednesday, July 1, 2009

Some questions about syntax

We are deciding what syntax to use on operators overloading and constructor.
We have C++ and Python syntax, and we have big differences between them.
A thread was created on cython-dev list for voting and commenting the choose of the syntax.
On C++ syntax, the constructor is a method with no return type (it's not void!) and the operators are methods with the keyword "operator" followed by the operator to overload (e. g. "bool operator==(int value);").
On Python, we have the special method __init__ for constructor and other special methods for the operators (__add__, __str__, etc.)

For more information, take a look at the wiki of the project:
http://wiki.cython.org/gsoc09/daniloaf/progress