diff options
| author | Joel Martin <github@martintribe.org> | 2014-10-25 13:00:01 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-01-06 21:58:57 -0600 |
| commit | 8f5b0f1040de849da3fb5ade645308e7bbe7f025 (patch) | |
| tree | a65a2e2c1db5013338a83af101becf676517ba1d /rust/src/step2_eval.rs | |
| parent | 0ab374bc261f871ab8fbbc13e0096f44225e2a3f (diff) | |
| download | mal-8f5b0f1040de849da3fb5ade645308e7bbe7f025.tar.gz mal-8f5b0f1040de849da3fb5ade645308e7bbe7f025.zip | |
Rust: add step3_env
Diffstat (limited to 'rust/src/step2_eval.rs')
| -rw-r--r-- | rust/src/step2_eval.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rust/src/step2_eval.rs b/rust/src/step2_eval.rs index 5df9a94..8d28a0f 100644 --- a/rust/src/step2_eval.rs +++ b/rust/src/step2_eval.rs @@ -6,6 +6,7 @@ extern crate regex; use std::rc::Rc; use std::collections::HashMap; + use types::{MalVal,MalRet,Nil,Int,Sym,List,Func}; mod readline; mod types; @@ -21,7 +22,7 @@ fn read(str: String) -> MalRet { fn eval_ast(ast: MalVal, env: &HashMap<String,MalVal>) -> MalRet { match *ast { Sym(ref sym) => { - match (*env).find_copy(sym) { + match env.find_copy(sym) { Some(mv) => Ok(mv), None => Ok(Rc::new(Nil)), } |
