* App -> Call.

* Allow booleans in package environment bindings (True maps to "1",
  False maps to "").
This commit is contained in:
Eelco Dolstra 2003-08-06 09:05:04 +00:00
parent d34b4d4f28
commit 37483672d4

View file

@ -161,7 +161,8 @@ static Expr evalExpr2(EvalState & state, Expr e)
} }
/* Application. */ /* Application. */
if (ATmatch(e, "App(<term>, [<list>])", &e1, &e2)) { if (ATmatch(e, "Call(<term>, [<list>])", &e1, &e2) ||
ATmatch(e, "App(<term>, [<list>])", &e1, &e2)) {
e1 = evalExpr(state, e1); e1 = evalExpr(state, e1);
if (!ATmatch(e1, "Function([<list>], <term>)", &e3, &e4)) if (!ATmatch(e1, "Function([<list>], <term>)", &e3, &e4))
throw badTerm("expecting a function", e1); 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)); 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); else throw badTerm("invalid package argument", value);
bnds = ATinsert(bnds, bnds = ATinsert(bnds,