[Gambas-user] Library and File

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


Le 15/11/2018 à 01:41, Benoît Minisini a écrit :
> 
> What you could have done is defining a unique parent exported class 
> named "Help", with "CREATE STATIC" and create an non-exported class 
> inheriting "Help" in each library (maybe keeping the "Help" name, i.e. 
> reimplement it), then returning a singleton of that class to the caller.
> 
> So for me that case is not a strong argument for allowing free access to 
> the library namespace from the outside. Or having one name space for 
> each library export. I don't know exactly what you suggest.
> 

Sorry it's late for me too, so I didn't see what your problem was exactly.

Actually it's not a problem with namespace at all.

It's the lack of "library metadata returned by code".

At the moment, all metadata needed by Gambas are stored as files in 
library/component archives, so it's not big deal to extract them.

But if you want to return some metadata from a method in a 
library-independant way, you can't. Your method must be in an exported 
class, and the exported class name must be predictable.

You tell me that you should be able to use the same name, making the 
difference by prefixing it with the component name (which you call 
"namespace"), avoiding to have a different class in each library.

But the real solution may be that one: assuming that an exported class 
having the "same" name (not really the same, but marshalled in an unique 
way) is a class reserved for metadata (the "ME" at the library/component 
level).

Anyway, I don't want a mechanisme that allows to access non-exported 
classes inside components/libraries. They are not exported. They are 
private!

-- 
Benoît Minisini


More information about the User mailing list