add mod and exp functions, tests, and also some snippets for common
patterns in the readme
This commit is contained in:
parent
7fd47c1812
commit
0c5d14ed8e
4 changed files with 323 additions and 13 deletions
22
src/stl.rs
22
src/stl.rs
|
|
@ -283,6 +283,28 @@ pub fn static_stdlib(syms: &mut SymTable) -> Result<(), String> {
|
|||
},
|
||||
);
|
||||
|
||||
syms.insert(
|
||||
"exp".to_string(),
|
||||
Symbol {
|
||||
name: String::from("exp"),
|
||||
args: Args::Lazy(2),
|
||||
conditional_branches: false,
|
||||
docs: math::EXP_DOCSTRING.to_string(),
|
||||
value: ValueType::Internal(Rc::new(math::exp_callback)),
|
||||
}
|
||||
);
|
||||
|
||||
syms.insert(
|
||||
"mod".to_string(),
|
||||
Symbol {
|
||||
name: String::from("mod"),
|
||||
args: Args::Lazy(2),
|
||||
conditional_branches: false,
|
||||
docs: math::MOD_DOCSTRING.to_string(),
|
||||
value: ValueType::Internal(Rc::new(math::mod_callback)),
|
||||
}
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue