rhai 0.13.0

Embedded scripting for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
// This script defines a function with two parameters

let a = 3;

fn addme(a, b) {
    a = 42;             // notice that 'a' is passed by value
    a + b;              // notice that the last value is returned even if terminated by a semicolon
}

print(addme(a, 4));     // should print 46

print(a);               // should print 3 - 'a' is never changed