[Gambas-devel] About gb.gsl components
Benoît Minisini
gambas at ...1...
Tue Jul 10 01:13:19 CEST 2012
Le 10/07/2012 00:50, Emil Lenngren a écrit :
> Some thoughts:
>
> Wouldn't it be better to be more generalized with all those operators?
> I mean now they have to be native functions in a special interface.
> Inheriting and virtual calls and other OO stuff doesn't seem to work
> with them.
>
> Why not simply see if an object has the method "_add" when you try to
> add an object with something? Then you are not restricted to native
> classes, but can use the "standard" principles and calling conventions
> and inheritance rules. Of course this will be slower than directly
> calling the correct C function through an interface but it won't be
> slower than a normal gambas call.
>
> /Emil
>
Mainly because of speed.
The '_operator' interface is a bit complex, but it is faster to call it
than using the special methods.
And I don't want to allow overriding operators in any class like in C++.
It leads to nightmare-code.
--
Benoît Minisini
More information about the Devel
mailing list