cpphs (was Re: Haskell on Red Hat Enterprise...)
Simon Marlow
simonmar at microsoft.com
Fri Mar 18 05:52:56 EST 2005
On 17 March 2005 23:03, Andy Moran wrote:
> Malcolm Wallace wrote:
>> Andy Moran <moran at galois.com> writes:
>>
>>> I notice that cpphs understands CPP stringification (if invoked with
>>> --hashes). Most of the gcc 3.4 failures (in fact, all of that I've
>>> seen) have to do with fooling -traditional into turning macro
>>> constants into Haskell strings, which can more readily be done with
>>> the #-operator. So, would using cpphs mean we could do away with
>>> the string gap hack?
>>
>> Without seeing the examples in question, I can't say for definite,
>> but cpphs /does/ preserve string gaps in source code in all cases.
>
> Here's an example, from 6.2.1's ghc/utils/ghc-pkg/Main.hs:
>
> -- hackery to convice cpp to splice GHC_PKG_VERSION into a string
> version :: String
> version = tail "\
> \ GHC_PKG_VERSION"
>
> HEAD uses a Makefile-generated Version.hs instead. Simon M.: are all
> instances of the above trick replaced by analogues of this much neater
> mechanism?
Yes, I fixed all these in 6.2.2 or thereabouts.
Cheers,
Simon
More information about the Glasgow-haskell-users
mailing list