scope keyword - a maintenance nightmare?
BCS
ao at pathlink.com
Fri Aug 17 23:42:32 PDT 2007
Reply to Guenther,
> Deewiant Wrote:
>
>> http://www.digitalmars.com/d/dcompiler.html#interface_files
>>
>> Unfortunately, this only separates interface descriptions from object
>> code. What
>>
> Thank you for pointing that out!
>
> It's a new feature too which I did not know about yet. It certainly
> wasn't there when I evaluated the language the first time.
>
> Sounds pretty useful. Seems to be more or less what I wanted.
>
> However, there is one thing left in the linked web page above like
> which I still find rather disturbing:
>
>> But they are not required in the way that C++ header files are, and
>> they are not part of the D language. They are a feature of the
>> compiler, and serve only as an optimization of the build process.
>>
> If they are not part of the language, then one is at the mercy of a
> compiler to provide them! And in fact, every compiler could do it its
> own way, using a different layout or even a different syntax if it
> wants to.
>
> It therefore seems more like the "precompiled header files" feature of
> some C/C++ compilers to me: While clearly useful, not all compilers do
> support it, and precompiled header files are typically not compatible
> between the different vendor's implementations.
>
> So let's hope .di files actually become part of the D language
> standard in a future revision of the language!
>
It isn't quite as good as being part of the language, but .di files are just
D code without the function bodies. If you ship object code, and a .di file,
then the worst that can happen is that the end user needs to rename the file
as a .d file. Heck, even if you use a compiler that doesn't generate .di
files, you can still run your code through one that does and then use the
files with whatever compiler you want.
More information about the Digitalmars-d
mailing list