#ifdef considered harmful

Wolfgang Jeltsch wolfgang at jeltsch.net
Tue Apr 6 21:18:53 EDT 2004


Am Dienstag, 6. April 2004 20:13 schrieb Isaac Jones:
> [...]

> >> (d) For those differences that cannot be eliminated implementing (in
> >> Haskell) a portable preprocessor that can ship as part of every Haskell
> >> environment?
> >
> > I think this is ultimately going to be the most viable solution.
> > Let's write a simple 'hspp' (in Haskell?) that is backward compatible
> > with 'cpp -traditional' (although we might also design a newer nicer
> > syntax too), and distribute it with every compiler.  It can't be
> > too difficult, surely?  Half of the cpp parsing/selection code is
> > already available within hmake.  I would take on the project myself,
> > if I had time.
>
> I agree that this should be possible with the hmake code.  FWIW, I
> have, in fact, already teased that functionality out (to a small
> degree) and made it available in my work-in-progress HMake API.

Will such a preprocessor work on source code like cpp does or on a syntax 
tree?  The latter would be better, IMO; the former would probably have little 
or no advantage over cpp.
  I
> [...]

Wolfgang



More information about the Libraries mailing list