[Gambas-user] Public and Private SUB in modules
Rolf-Werner Eilert
eilert-sprachen at ...221...
Fri Dec 21 08:30:16 CET 2012
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
More information about the User
mailing list