
21 Jul
2005
21 Jul
'05
10:12 a.m.
On Thu, Jul 21, 2005 at 12:32:21AM -0500, Brian Smith wrote:
(3) It would be useful if Cabal/GHC/Hugs/etc. #defined symbols for installed packages. This would allow us to write:
module My.Program.Compat.Lib(foo1, foo2,foo3) #if __PACKAGE_foo__ >= 110 -- Is package foo-1.1 or later available? import Foo(foo1,foo2,foo3) #else
Perhaps this is something cpphs could provide? #if cabal(foo >= 1.1.0) ... (or whatever syntax you like). It can import the relevant stuff from Distribution.* to do the version checking bit. It would probably need to take a command line parameter of some form that allowed it to know what was being compiled with. Thanks Ian