> I've just been looking at using cpp in Haskell scripts and I am rather
> confused. I can't see anything in the report which gives
> special meaning
> to # in the surrounding text of literate scripts, yet if I put such
> things in (both cpp directives and random things) both nhc98 and ghc
> give me errors:
>
> $ rm Foo.{o,hi}; nhc98 -c Foo.lhs -o Foo.o
> Unknown preprocessor directive at line 4 in file ./Foo.lhs
> ifdef QQ
>
> $ rm Foo.{o,hi}; ghc -c Foo.lhs -o Foo.o
> Foo.lhs:4: parse error on input `#'
>
> Are ghc and nhc98 being incompatible with Haskell 98?
GHC has one small extension to Haskell 98 in this area: the lexical
analyser interprets directives line '# 99 "Foo.hs"' at the beginning of
a line in order to get line number and file clues when it is parsing the
output from CPP. Apart from this, '#' should be interpreted exactly as
per the report (when -fglasgow-exts is off).
Could you send us the source?
Cheers,
Simon
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell