diff options
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r-- | src/libexpr/eval.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 7ee157c316ac..b4d76a137a1a 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -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); } |