On Fri, Dec 21, 2012 at 7:10 AM, Дмитро Бєлєвцов <
belev...@gmail.com> wrote:
> @Stefan, pure virtual methods (i.e. "virtual void method() = 0")
[As a total aside, speaking of ugliness, I always wonder who came up
with that horrendous syntax for C++.]
> don't need
> to be implemented in the base class. If it was possible to create these in
> cython, one wouldn't have to compile base.so, which contains no useful
> information anyway. In my case, I need an efficient small program to try out
> various modifications of different neuron models, no big deal, so having
> interfaces will considerably reduce the clutter in the code, comparing to
> normal inheritance.
Even when we get interfaces, that doesn't mean there won't be a
corresponding .so file. (Where else would you put the common interface
type information?) Java produces .class files for its interfaces, and
the only reason you don't see one in C++ is that it's entirely
contained in the header file (so compiled anew by each source
#including it, nothing to do with it being virtual (e.g any template
class must be done in this way)). pxd files are not header files.
> @Robert
>> I don't think that's really so bad
>
> Well, fair enough, this is not a critical issue and it certainly doesn't
> prevent me from getting desired behavior, It's just that this little
> base_class.so is extremely annoying, because it never gets directly imported
> in python, neither the interface implementation which it contains ever gets
> used. Anyhow, I'll then try to take advantage of base class' this
> implementation and add some common helper methods there.
>
>> On this note, several of us have (independently even) thought about
> adding go-style interfaces to Cython, which are even more dynamic.
>
> Yeah, java or go-style interfaces will be highly appreciated! I'd love to
> contribute, I'm not sure though if I'm competent enough to do so. Has anyone
> already started working on this?
No one's started as far as I know, though it would be a fairly involved change.
> Пʼятниця, 21 грудня 2012 р. 10:54:23 UTC+1 користувач Robert Bradshaw