mtots_core 0.1.2

Core implementation of the mtots scripting language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

pub(super) fn new() -> Rc<Class> {
    Class::new(
        "Number".into(),
        Class::map_from_funcs(vec![NativeFunction::new(
            "fract",
            ["self"],
            "",
            |_globals, args, _| {
                let mut args = args.into_iter();
                let x = args.next().unwrap().f64()?.fract();
                Ok(x.into())
            },
        )]),
        HashMap::new(),
    )
}