Function lamcal::var [−][src]
pub fn var(
name: impl Into<String>
) -> Term
Constructs a variable of the given name.
This is a convenience function for constructing a
Term
of variant Term::Var
in a readable form with
minimal keystrokes. It takes any value that can be converted into a String
and returns Term::Var(name)
.
This function combined with the functions lam
and
app
let us construct any Term
in the
pure lambda calculus.
Example
let variable = var("x"); assert_eq!(variable, Term::Var("x".to_string()));