D modules/sourcecode organisation/filesystem mapping

Carlos Santander csantander619 at gmail.com
Fri May 12 06:27:40 PDT 2006


FunkyM escribió:
> 
> I still have trouble to fully understand why you check gtk vs gtk.gtk.
> Assuming you try to point out a possible problem when multiple package levels
> have the same name, after having name mangling applied.
> 

Consistency. In /gtk.d you're asking the compiler to treat it just as gtk, but 
in /gtk/window.d you're asking it to be gtk.window. So, if the rules are not 
clearly defined, the compiler could think that /gtk.d is gtk.gtk.

> The compiler generates (I made a simple test to verify) the one dependent on
> your qualification like this:
> 
> /gtk.d        -> _D3gtk5fooi
> /gtk/gtk.d    -> _D3gtk3gtk5fooi
> /gtk/window.d -> _D3gtk5fooi (since the file used "module gtk;")
> 
> That does not look problematic to me regarding locating which member belongs to
> which package? (Did I overlooked something?)
> 
> Now I think all the implementation seems more and more trivial and somehow
> reflects the "already indirectly supported" stuff showing up.
> 

I'm not really sure about what you did because you're using "module" in a 
different way than it's supposed to be right now.

Anyway, try this: add /gtk/button.d (or whatever) and also use in it "module 
gtk;". Now try to compile button and window, and pretty sure the compiler will 
give you an error message (module gtk is multiple defined, or something like that).

> --- Martin Szulecki



-- 
Carlos Santander Bernal



More information about the Digitalmars-d mailing list