[Gambas-user] Public and Private SUB in modules

Benoît Minisini gambas at ...1...
Thu Dec 20 13:20:32 CET 2012


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,

-- 
Benoît Minisini




More information about the User mailing list