D, Java? To D or not to D?

Georg Wrede georg at nospam.org
Fri Jan 5 13:58:32 PST 2007


Frits van Bommel wrote:
> Alexander Panek wrote:
>> TPJ wrote:

>>> 2) From FAQ: Since D can call C functions, any GUI library with a
>>> C interface is accessible from D. Does it mean that I can access
>>> *any* C library from D? If so, it a great feature!
>> 
>> Yes, any C library. 
> 
> You need to convert C headers to D import modules to use them though.
> It shouldn't be too hard unless too much preprocessor tricks are
> used, but it might be a bit of work for large files.

It's actually a lot easier than it sounds. :-)

And, there's no use converting everything, just convert the things in a 
C header that your program _actually_ uses! (Most people feel an 
inexplicable urge to convert the whole header file "just in case", or 
"later I'm going to need it anyway". Don't.)

Also, if the header file looks like "an exuberant show-off of 
preprocessor wizardry", then you might want to run it thorugh the 
preprocessor, and compare it with the original.



More information about the Digitalmars-d mailing list