Why the compiler dosen't enforce correct module declarations?

Ary Manzana ary at esperanto.org.ar
Sat May 12 11:33:10 PDT 2007


Chris Nicholson-Sauls escribió:
> Ary Manzana wrote:
>> Manfred Nowak escribió:
>>> Ary Manzana wrote
>>>
>>>> In http://www.digitalmars.com/d/module.html it states:
>>>
>>> | The ModuleDeclaration sets the name of the module and what package
>>> | it belongs to. If absent, the module name is taken to be the same
>>> | name (stripped of path and extension) of the source file name.
>>>
>>> Please read carefully.
>>
>> So what's the point of settings a package and module name different 
>> than what's in the filesystem?
> 
> Its useful as an alternative means of doing platform-versioning.

Why use an alternative of the built-in version system?

Also, if you have many versioned modules (a1_win32.d, a1_linux.d, 
b1_win32.d, b1_linux.d, etc.) you need to change the command line for 
each of the modules, instead of just changing the version passed. You 
also have to tell the other developers: remember not to use the version 
flag, but to change the suffix of the filenames according to the version...

Maybe doing the suffix thing is valid for C or C++, but I think D tries 
to solve that using versions, and not using them seems awkward to me.


More information about the Digitalmars-d-learn mailing list