From 94cf1f86bb5d8516583f0d39ad22dbc853019798 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 18 Jun 2003 12:36:12 +0000 Subject: * Lambdas, applications, substitutions. --- src/eval.hh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/eval.hh') diff --git a/src/eval.hh b/src/eval.hh index 719edb143354..2e764b1bd595 100644 --- a/src/eval.hh +++ b/src/eval.hh @@ -60,6 +60,12 @@ using namespace std; makeArg(Arg(Str(nm), (Bool(True), _))) => (nm, "1") makeArg(Arg(Str(nm), (Bool(False), _))) => (nm, undef) + subst(x, e1, e2) is defined as a generic topdown term + traversal of e2, replacing each `Var(x)' with e1, and not + descending into `Lam(x, _)'. + + Note: all stored expressions must be closed. !!! ugly + getFile :: Hash -> FileName loadExpr :: Hash -> FileName hashExpr :: Expr -> Hash @@ -76,6 +82,9 @@ Expr evalValue(Expr e); /* Return a canonical textual representation of an expression. */ string printExpr(Expr e); +/* Perform variable substitution. */ +Expr substExpr(string x, Expr rep, Expr e); + /* Hash an expression. */ Hash hashExpr(Expr e); -- cgit 1.4.1