A simple formula interpreter
问题 To understand Rust, I am trying to implement a little formula interpreter. An expression can only be an integer, a sum, a variable ( Term ) or an assignment ( Set ). We can then evaluate an expression. Since symbols with no associated values can appear in an expression, its evaluation yields another expression (and not necessarily an integer). The values of the variables (if there are any) can be found in a hash table. use std::rc::Rc; use std::collections::HashMap; enum Expr { Integer(i32),