On Wed, 2010-01-13 at 22:42 +0100, Henning Thielemann wrote: > Maciej Piechotka schrieb: > > > > Not quite. While I agree that "the *frequent* need for a preprocessor > > shows omissions in (the design of) a language." it is not necessary the > > case. Preprocessor may be useful if: > > > > - there is a new beatyful feature in newer version of compiler but you > > still want to have backward compatibility. > > - there are compiler or platform dependant elements. For example if you > > write a driver in Haskell you may want to share code as much as possible > > but you need to know 1) the size of registers and 2) the platform you're > > writing as Windows have quite different API then Linux or BSD. > > - You need to enable/disable features at build-time. It is not frequent > > at closed-source system but it is frequent on OpenSource systems. For > > example I might need to have minimal program for embedded system but > > with full feature set it likly conquer the desktops > > > Many of these problems are solved by preprocessor intervention in C/C++, > but there is often no need to do so. You could also write system > dependent modules, where the right module for your system is included by > the build system. I hope the build system does not count as a > preprocessor. In Haskell it is however still no fun to support multiple > versions of the base libraries, not to speak of different compilers - > and their set of libraries. > > Unfortunately, the original question is still not answered. >
Hmm. May I ask how to do for example something depending on POSIX or WinAPI? I am sorry but I cannot see how any of the above problems could be solved. Regards
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
