Proposed improvements to the separate compilation model

so so at so.so
Sat Jul 23 16:21:53 PDT 2011


On Sun, 24 Jul 2011 02:10:47 +0300, Daniel Gibson <metalcaedes at gmail.com>  
wrote:

> Am 24.07.2011 01:02, schrieb so:
>> On Sun, 24 Jul 2011 01:47:32 +0300, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> and then either remove the .tmp if identical or rename it forcefully
>>> to filename.di if different. That's a classic in code generation tools.
>>
>> Not sure i got it right but how renaming it forcefully would solve this?
>> This must be two separate process for the compiler, issuing an error and
>> if it was intended then the .di file must be generated.
>
> Because if not done forcefully there may be an error because filename.di  
> already exists.

What i meant is:

You got file.di file.d, file.di being your reference.
You got a conflict. Now this conflict could be a result of something not  
intended and it most likely wasn't intended because file.di is your  
reference and you don't change many things often in there. There IMO you  
should just issue an error and let the user deal with it by explicitly  
generating file.di from file.d, if you are doing this explicitly compiler  
just shouldn't bother if it was already there. (again it is free to  
compare results of these two and keep the old one if they are same)

Doing this forcefully also is a solution but it better be optional (a  
compiler flag) not the default.


More information about the Digitalmars-d mailing list