talc/talc-std/src/lib.rs

42 lines
755 B
Rust
Raw Normal View History

2024-02-23 19:54:34 +00:00
use talc_lang::{symbol::{symbol, Symbol}, Vm};
2024-02-27 05:18:43 +00:00
pub mod value;
2024-02-23 19:54:34 +00:00
pub mod io;
pub mod iter;
pub mod exception;
2024-02-27 05:18:43 +00:00
pub mod num;
pub mod collection;
2024-03-30 16:21:09 +00:00
pub mod string;
pub mod file;
pub mod regex;
2024-02-27 05:18:43 +00:00
#[cfg(feature="random")]
pub mod random;
2024-02-23 19:54:34 +00:00
pub fn load_all(vm: &mut Vm) {
2024-02-27 05:18:43 +00:00
value::load(vm);
exception::load(vm);
iter::load(vm);
collection::load(vm);
num::load(vm);
io::load(vm);
2024-03-30 16:21:09 +00:00
string::load(vm);
regex::load(vm);
file::load(vm);
2024-02-27 05:18:43 +00:00
#[cfg(feature="random")]
random::load(vm);
2024-02-23 19:54:34 +00:00
}
lazy_static::lazy_static! {
2024-02-27 05:18:43 +00:00
pub static ref SYM_IO_ERROR: Symbol = symbol!(io_error);
pub static ref SYM_FORMAT_ERROR: Symbol = symbol!(format_error);
2024-02-27 05:18:43 +00:00
}
macro_rules! unpack_args {
($e:expr) => {
($e).try_into().expect("bypassed arity check")
};
2024-02-23 19:54:34 +00:00
}
2024-02-27 05:18:43 +00:00
pub(crate) use unpack_args;