From bbeb1b87c2b848189c0f71c93cf4b70b32d45a4d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 5 Mar 2015 00:22:43 -0800 Subject: Update Rust code to the current Rust nightly Lots of changes! Hopefully everything is still semantically equivalent (tests still pass) --- rust/src/bin/step0_repl.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 rust/src/bin/step0_repl.rs (limited to 'rust/src/bin/step0_repl.rs') diff --git a/rust/src/bin/step0_repl.rs b/rust/src/bin/step0_repl.rs new file mode 100644 index 0000000..030c551 --- /dev/null +++ b/rust/src/bin/step0_repl.rs @@ -0,0 +1,26 @@ +extern crate mal; + +use mal::readline::mal_readline; + +// read +fn read(str: String) -> String { + str +} + +// eval +fn eval(ast: String) -> String { + ast +} + +// print +fn print(exp: String) -> String { + exp +} + +fn main() { + loop { + let line = mal_readline("user> "); + match line { None => break, _ => () } + println!("{}", print(eval(read(line.unwrap())))); + } +} -- cgit v1.2.3