D modules/sourcecode organisation/filesystem mapping

FunkyM FunkyM_member at pathlink.com
Fri May 12 11:27:12 PDT 2006


In article <e42g7v$2pfk$1 at digitaldaemon.com>, Bruno Medeiros says...
>
>FunkyM wrote:
>> 
>> Yeah, infact it is a basic change mainly on the "module" keyword. My "extended"
>> explaination might be a bit too much information on one shot.
>> 
>> Right now you for a file "/foo/bar.d" you would have to write "module foo.bar;"
>> and you can NOT have a file "/foo.d" with "module foo;".
>> 
>> These changes make it possible to say "module foo;" in "/foo/bar.d" and use
>> "/foo.d" with "module foo;" which results in "merging" the two scopes.
>> 
>
>What happens when both "module foo;"'s have module 
>constructors/destructors ?
>

Not absolutely sure about that.

If the changes for the "solution" would get applied, I guess by roughly judging
from the DMD frontend sources, the static constructors/destructors would get
called per "module file".

Their order in that case remains: "The order of static initialization is
implicitly determined by the import declarations in each module.", as from D
language spec and judged by DMD frontend sources. (In above scenario you still
write "import foo, foo.bar;")

I am trying myself in altering the DMD frontend adding my proposal in order to
strive upon all impacts of a change. This is sure one to be discussed/defined.

--- Martin Szulecki



More information about the Digitalmars-d mailing list