mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
* Added plain lambdas, e.g., `let { id = x: x; const = x: y: x; }'.
`bla:' is now no longer parsed as a URL. * Re-enabled support for the `args' attribute in derivations to specify command line arguments to the builder, e.g., ... builder = /usr/bin/python; args = ["-c" ./builder.py]; ...
This commit is contained in:
parent
f8cd904e05
commit
db3e644c1c
5 changed files with 64 additions and 38 deletions
|
@ -195,6 +195,7 @@ Expr evalExpr2(EvalState & state, Expr e)
|
|||
cons == "Int" ||
|
||||
cons == "Bool" ||
|
||||
cons == "Function" ||
|
||||
cons == "Function1" ||
|
||||
cons == "Attrs" ||
|
||||
cons == "List"))
|
||||
return e;
|
||||
|
@ -226,6 +227,12 @@ Expr evalExpr2(EvalState & state, Expr e)
|
|||
return evalExpr(state,
|
||||
substArgs(e4, formals, evalExpr(state, e2)));
|
||||
|
||||
else if (atMatch(m, e1) >> "Function1" >> name >> e4) {
|
||||
ATermMap subs;
|
||||
subs.set(name, e2);
|
||||
return evalExpr(state, substitute(subs, e4));
|
||||
}
|
||||
|
||||
else throw badTerm("expecting a function or primop", e1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue