Simon Peyton-Jones <[EMAIL PROTECTED]> wrote,

> > programming language.  IMHO all uses of cpp in Haskell have
> > either to do with other non-standard-conformance (eg, using
> > unboxed values in GHC, but wanting to use Hugs also) or are
> > plainly unnecessary, 
> 
> I'm not sure I agree with this.  Keith Wansbrough has an interesting
> paper that identifies the ways in which a macro processor can
> do thing that ordinary functions can't.   

Is this paper available somewhere?

> One solution is to add
> macros (presumably in a more hygienic form than cpp), but I'm reluctant
> to advocate that, because macros undoubtedly do overlap with functions.
> 
> So I'm waiting and hoping that someone will have a Really Good Idea.
> (And using cpp meanwhile.)

IMHO the uses of cpp that are not related to the use of
other non-standard features usually have to do with
configuration (eg, to adapt to some system-dependent
parameters or to choose whether or not to activate a feature
of the program).  My main grudge with using cpp for this
purpose is that any changes (like substitutions) that are
necessary in the program source for the purpose of
configuration should be made at configuration time and not
at compile time.  The use of cpp - as, for example, opposed
to autoconf - delays the application of the configuration
decision to compile time, which is IMHO conceptually wrong.
(As witnessed by the awkwardness of having to deal with
cpp-mediated configuration decisions when loading Haskell
files into Hugs - which initiated this discussion.)

Manuel



Reply via email to