pub macro conlang(
$($t:tt)*
) {
...
}
Expand description
Constructs a function which evaluates a Conlang Block
ยงExamples
Bind and use a variable
use cl_embed::{conlang, Environment, Value};
let mut env = Environment::new();
// Bind a variable named `message` to "Hello, world!"
env.bind("message", "Hello, World!");
let print_hello = conlang!{
println(message);
};
// Run the function
let ret = print_hello(&mut env)?;
// `println` returns Empty
assert!(matches!(ret, Value::Empty));