From 37483672d425bc3b7be8e1deb049fd04c80be0cf Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 Aug 2003 09:05:04 +0000 Subject: * App -> Call. * Allow booleans in package environment bindings (True maps to "1", False maps to ""). --- src/fix.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/fix.cc b/src/fix.cc index 9111cd372..420dd7c04 100644 --- a/src/fix.cc +++ b/src/fix.cc @@ -161,7 +161,8 @@ static Expr evalExpr2(EvalState & state, Expr e) } /* Application. */ - if (ATmatch(e, "App(, [])", &e1, &e2)) { + if (ATmatch(e, "Call(, [])", &e1, &e2) || + ATmatch(e, "App(, [])", &e1, &e2)) { e1 = evalExpr(state, e1); if (!ATmatch(e1, "Function([], )", &e3, &e4)) throw badTerm("expecting a function", e1); @@ -277,6 +278,12 @@ static Expr evalExpr2(EvalState & state, Expr e) } fs.derive.env.push_back(StringPair(key, s1)); } + else if (ATmatch(value, "True")) { + fs.derive.env.push_back(StringPair(key, "1")); + } + else if (ATmatch(value, "False")) { + fs.derive.env.push_back(StringPair(key, "")); + } else throw badTerm("invalid package argument", value); bnds = ATinsert(bnds, -- cgit v1.2.3