rhai/examples/hello.rs
2016-04-13 18:40:06 -07:00

10 lines
203 B
Rust

extern crate rhai;
use rhai::Engine;
fn main() {
let mut engine = Engine::new();
if let Ok(result) = engine.eval::<i64>("40 + 2") {
println!("Answer: {}", result); // prints 42
}
}