[Gambas-user] Library and File

Benoît Minisini g4mba5 at gmail.com
Thu Nov 15 00:18:43 CET 2018


Le 15/11/2018 à 00:02, Christof Thalhofer a écrit :
> Hi Tobi,
> 
> Am 14.11.18 um 10:00 schrieb Tobias Boege:
>> [1] https://lists.gambas-basic.org/pipermail/user/2018-August/065319.html
> 
> YES! .../ would be really ugly. Soo ...
> 
> namespaces would be the answer to the problems addressed by this mail.
> 
> The files in the libs (and code also) cold savely be adressed by
> something (as an example) like
> 
> vendorname/version/./directory/file
> 
> or
> 
> vendorname/../directory/file
> 
> for the latest version
> 
> (if vendorname was done right)
> 
> I think, libraries together with namespaces could gain a great potential
> to boost the usage of Gambas. With them people could share code freely
> without the pain of conflicting names.
> 
> Languages like Java, Python, PHP show that with namespaces the
> production of shared code literally explodes. Together with the
> importance and the potential of the language itself.
> 
> In Gambas I would like to, but cannot share my own code with others
> because I never know whether my own code breaks things in other
> environments.
> 
> I am not able to use foreign code without copy/paste it into my own (and
> do some rework to make it compatible). If the foreign code evolves, I
> cannot benefit from that easily without copy/paste/rework ... thats
> really ugly compared to sth like PHP composer where I just do
> 
> "./composer update"
> 
> to get the updated lib via Git in the background.
> 
> As we have vendorname for libs already, why not use it as namespace?
> 
> But the concept should be well designed, because once on the road it
> would be hard to stop.
> 
> Alles Gute
> 
> Christof Thalhofer
> 

Can you elaborate with a precise example?

Each library already has its own namespace.

Only the exported classes share the same namespace, and if two libraries 
export the same class, then that usually means they want to do the same 
thing and cannot be used simultaneously.

Regards,

-- 
Benoît Minisini


More information about the User mailing list