DMD 1.005 release

Walter Bright newshound at digitalmars.com
Tue Feb 6 23:16:17 PST 2007


Hasan Aljudy wrote:
> Walter Bright wrote:
>>  From my point of view, evil uses of it are things like version control:
>>
>>     mixin(import("versions.txt"));
>>
>> where versions.txt contains:
>>
>>     version = FOO;
>>     version = BAR;
>>
>> etc., or other uses that subvert the right way to do things. One 
>> should think long and hard about using textual import to import D code.
> 
> Why is that evil? I think it's actually a great idea. "versions" are a 
> sort of configuration that determines which code should be compiled and 
> which code shouldn't. Storing this configuration in a separate file 
> makes sense to me.

The right way to do versions that cut across multiple files is to 
abstract the versioning into an API, and implement the different 
versions in different modules.

This is a lot easier to manage when you're dealing with larger, more 
complex code, although it is more work up front.



More information about the Digitalmars-d-announce mailing list