state of the cabal (preprocessors)

Henrik Nilsson nhn at Cs.Nott.AC.UK
Tue Oct 26 18:31:55 EDT 2004


Isaac Jones writes:

 > For hugs this would mean preprocessing all files and putting the new
 > .hs files into a temp directory and compiling these.

I thought it would mean that the build system (Cabal's builtin one, a 
make-based one, ...) would run the sources through CPP prior to 
installing the preprocessed sources wherever the library/application
in question should be installed?

This was discussed a week or so ago, and my impression was that people
agreed that this is the best approach to preprocessing for Hugs.

This also happens to be how the Yampa/Yale make-based build system
handles preprocessing for Hugs, and it works quite well.

So why a "temp" directory? And did you really mean "interpreting"
rather than "compiling"?

 > Hopefully, there
 > will be directives in the preprocessed sources to refer back to the
 > original source,

That depends on which CPP is used, and how CPP is invoked, so it would
really be up to the build system.

E.g. the man page for CPP on my system says that "-P" inhibits the
generation of linemarkers in the output.

 > and hugs should report errors against the original
 > source lines rather than the preprocessed source lines.  Is hugs able
 > to do this already?

At least in the Yampa/Yale build system we invoked CPP with "-P" when
preprocessing sources for Hugs to keep Hugs happy. So at least a year or
so ago, Hugs did not understand line directives, as far as I can tell.
Maybe that has now changed?

All the best,

/Henrik

-- 
Henrik Nilsson
School of Computer Science and Information Technology
The University of Nottingham
nhn at cs.nott.ac.uk

This message has been scanned but we cannot guarantee that it and any
attachments are free from viruses or other damaging content: you are
advised to perform your own checks.  Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.



More information about the Libraries mailing list