use crate::sexp::{SExp, SExp::*, SLeaf::*, util::*}; impl SExp { /// Performs substitution on the s-expression. /// /// Replaces all free occurrences of variables /// named `name` with the given `value` /// in this s-expression. /// ```rust /// use melisp::sexp::{SExp::*, SLeaf::*, util::*}; /// /// assert_eq!( /// scons(Add, scons(var("a"), var("b"))).subst("b", scons(Sub, scons(2, 1))), /// scons(Add, scons(var("a"), scons(Sub, scons(2, 1)))) /// ); /// ``` pub fn subst(self, name: &str, value: SExp) -> SExp { todo!(); } }