Various software and a question

Koen Claessen koen@cs.chalmers.se
Fri, 2 Feb 2001 10:15:17 +0100 (MET)


Ian Lynagh wondered:

 | is there a nicer way to do something like
 |
 |     #ifdef __GLASGOW_HASKELL__
 |     #include "GHCCode.hs"
 |     #else
 |     > import HugsCode
 |     #endif

I usually make two directories:

  Hugs/
  Ghc/

That contain files with the same names but different
compiler-dependent implementations. Then it is just a
question of setting the PATHs right.

I hate using C preprocessor stuff for this. I think the
directory solution is nice because it forces you to
concentrate all the compiler-dependent stuff into a few
modules, which are distinct from the rest of the
implementation.

/Koen.

--
Koen Claessen         http://www.cs.chalmers.se/~koen
phone:+46-31-772 5424      mailto:koen@cs.chalmers.se
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden