[Gambas-user] Public and Private SUB in modules

Tobias Boege taboege at ...626...
Fri Dec 21 11:13:26 CET 2012


On Fri, 21 Dec 2012, Rolf-Werner Eilert wrote:
> 
> 
> Am 20.12.2012 13:20, schrieb Beno?t Minisini:
> > Le 20/12/2012 13:04, Rolf-Werner Eilert a ?crit :
> >>
> >> The event comes from another object, I understand that, so that's why.
> >> Thank you!
> >>
> >> Rolf
> >>
> >
> > To give you more details:
> >
> > In most languages, public / private / friend... are a mix of telling
> > which symbols are exported at runtime and some syntactic sugar.
> >
> > In Gambas, I kept only the runtime definition, (which I could call the
> > real effective one). "Public" means "accessible from another class", and
> > "Private" means the contrary.
> >
> > And it's effective. If something is private, you won't see any symbol
> > for it in the object file (unless debugging symbols are enabled).
> >
> > The only syntactic sugar is in the IDE : if a public symbol has an
> > underscore in it, it will be usually hidden in automatic completion or
> > debugging windows. But that's all. For the compiler and the interpreter,
> > it is as public as any other public symbol.
> >
> > I did that for the sake of simplicity and clarity. Because people often
> > don't understand the difference between what is syntactic sugar
> > (implemented at the compiler level) and what is real (implemented at the
> > interpreter level).
> >
> > Regards,
> >
> 
> Very interesting, yes that makes sense :-)
> 
> On the other hand, I don't understand why the interpreter doesn't find
> 
> Public Sub _myPrinter_Draw()
> 
> anymore. Did I get that wrong?
> 
> Regards
> 
> Rolf

Did you rename the actual object "myPrinter" to "_myPrinter", too? I assume
that this must be done...

Regards,
Tobi




More information about the User mailing list