Function libunseemly::alpha::substitute[][src]

pub fn substitute(node: &Ast, env: &Assoc<Name, Ast>) -> Ast
Expand description

Substitute VariableReferences in node, according to env. TODO: don’t use this to “capture the environment”; it doesn’t work in the presence of recursion Instead, we should introduce a “constant” to Beta. (Does SameAs suffice now?) TODO: because of mu’s use of VariableReferences in a place where other Asts are forbidden, it seems like this has limited use. TODO: this isn’t capture-avoiding (and shouldn’t be, when called by freshen_rec) It’s safe to use when the RHS of the environment is just fresh names.