[Gambas-user] Inheriting Stream in a Gambas class?

Tobias Boege taboege at ...626...
Tue Jul 29 15:24:54 CEST 2014


On Tue, 29 Jul 2014, Beno?t Minisini wrote:
> Le 29/07/2014 12:46, Tobias Boege a ?crit :
> > Hi Benoit,
> >
> > is there currently the possibility to "Inherits Stream" in a class written
> > in Gambas, so that it can be used as a Stream? If not, is it a goal for
> > Gambas 4?
> 
> It should be possible, did you try?
> 

I didn't know what to do. I wrote

  Inherits Stream

into my class and then hesitated: I could instantiate the class but a

  Print #myObject, "test"

failed, of course, because my class has no methods related to Stream and I
don't know where to put them, and what exactly.

> >
> > Also re-read this mail substituting "Stream" by "the _convert and _operator
> > interfaces seen in gb.gsl".
> 
> for _convert, maybe. For _operator, I don't want, otherwise it will lead 
> to the C++ delirium with operator reimplementation.
> 

I find this operator reimplementation thing very nifty in theory (just as
function overloading ;-)). But I haven't seen that much C++ source code.
Maybe they can turn it into hell. Well, there is a time and place for every
concept, and I'm OK if Gambas isn't for these.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list