use crate::sexp::SExp; use crate::sexp::SLeaf; use crate::sexp::SExp::*; use crate::sexp::SLeaf::*; impl From for Box { fn from(int: i32) -> Self { Box::new(Atom(Int(int))) } } impl From for Box { fn from(leaf: SLeaf) -> Self { Box::new(Atom(leaf)) } } impl From for SLeaf { fn from(int: i32) -> Self { Int(int) } } pub fn scons(x: impl Into>, y: impl Into>) -> SExp { SCons(x.into(), y.into()) } pub fn var(name: &str) -> SExp { Atom(Var(name.to_string())) }