[darcs-devel] darcs patch: Rename bound variable in fromJust macro.

David Roundy droundy at darcs.net
Mon Jul 18 06:42:39 PDT 2005


On Sun, Jul 17, 2005 at 03:12:46PM +0200, Josef Svenningsson wrote:
> On 7/17/05, David Roundy <droundy at abridgegame.org> wrote:
> > On Sun, Jul 17, 2005 at 12:18:00AM +0200, Juliusz Chroboczek wrote:
> > >   Could we please use Lisp macros instead?
> > 
> > Indeed, the C preprocessor is an ugly solution.  I have several times run
> > into trouble because a variable ending with ' causes the C preprocessor to
> > fail to expand an impossible or fromJust.  I assume you're joking about
> > Lisp macroe? I'm open to suggestions as to a better preprocessing plan.
> > 
> > One option would be to go to template haskell, which I believe can do this
> > kind of line number trick, the catch there being that we'd probably have to
> > write $fromJust and $impossible to make them expanded by template haskell.
> > The other problem with this would be (I believe) that it would truly wed us
> > to ghc.  Perhaps that's not a serious problem, but I'm more comfortable
> > imagining that we are writing portable code.
> > 
> > For just doing impossible.h (which defines only two macros), we could even
> > write our own preprocessor.  That would seem awfully silly, though...
> >
> I think the best option would be to use cpphs:
> http://www.cs.york.ac.uk/fp/cpphs/
> 
> It's a Haskell compliant cpp. Darcs isn't the only Haskell project
> that has had problems with cpp..

I'm not sure it's worth requiring users to install cpphs just to compile
darcs.  As Juliusz says, cpp isn't *that* bad, and many users have enough
trouble just installing ghc...
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list