[Gambas-user] New namespace support
Gianluigi
bagonergi at gmail.com
Thu Feb 3 18:15:45 CET 2022
Il giorno gio 3 feb 2022 alle ore 17:39 Benoît Minisini <g4mba5 at gmail.com>
ha scritto:
Hi Benoit,
The code you posted is right, I can't give you a better example.
>
LOL
> I still don't understand what you don't understand. :-)
>
> A class has a name. Its name is stored in a symbol table, that is
> private to the project/component/library it is declared in.
>
> An exported class has a second name, a public name, that is stored in
> another symbol table, the global symbol table, that is shared by the
> project and all components and libraries.
>
> Before namespaces, the public name was always the same as the private
> name. As that name is shared by everyone, collisions may occur.
>
> So the namespace feature just allows to choose what the public name is,
> using a convention: everything before ':' is the namespace, and two
> different people or organization should use different namespaces, to
> avoid collisions.
>
> Once your public class name is "GianLuigi:MyClass", you have to use "New
> GianLuigi:MyClass" to instanciate the class outside of the
> project/component/library it is declared in.
>
> Is it clearer now?
Yes now it is clearer, collisions become more difficult.
When it comes to Classes and Objects the single neuron spinning in my head
tends to slow down frighteningly.
Exactly like when I compare myself with git :-(
Thank you very much
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220203/5be833ff/attachment.htm>
More information about the User
mailing list