Various software and a question

Hi all First a brief question - is there a nicer way to do something like #ifdef __GLASGOW_HASKELL__ #include "GHCCode.hs" #else > import HugsCode #endif than that (i.e. code that needs to be different depending on if you are using GHC or HUGS)? Secondly, I don't know if this sort of thing is of interest to anyone, but inspired by the number of people who looked at the MD5 stuff I thought I might as well mention it. I've put all the Haskell stuff I've written at http://c93.keble.ox.ac.uk/~ian/haskell/ (although I'm new at this game so it may not be the best code in the world). At the moment this consists of a (very nearly complete) clone of GNU ls, and MD5 module and test program and the smae for SHA1 and DES. The ls clone needs a ptch to GHC for things like isLink (incidentally, would it be sensible to try and get this included with GHC? It is basically a simple set of changes to the PosixFiles module, but needs __USE_BSD defined (which I guess is the reason it is not in there, but it could have it's own file?)). Have fun Ian, wondering how this message got to be so long

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
participants (2)
-
Ian Lynagh
-
Koen Claessen