use talc_lang::{symbol::{symbol, Symbol}, Vm}; pub mod value; pub mod io; pub mod iter; pub mod exception; pub mod num; pub mod collection; pub mod string; pub mod file; pub mod regex; #[cfg(feature="random")] pub mod random; pub fn load_all(vm: &mut Vm) { value::load(vm); exception::load(vm); iter::load(vm); collection::load(vm); num::load(vm); io::load(vm); string::load(vm); regex::load(vm); file::load(vm); #[cfg(feature="random")] random::load(vm); } lazy_static::lazy_static! { pub static ref SYM_IO_ERROR: Symbol = symbol!(io_error); } macro_rules! unpack_args { ($e:expr) => { ($e).try_into().expect("bypassed arity check") }; } pub(crate) use unpack_args; macro_rules! unpack_varargs { ($e:expr) => {{ let mut args = $e; let Value::List(varargs) = args.pop().expect("bypassed arity check") else { panic!("bypassed arity check") }; let varargs = ::std::rc::Rc::unwrap_or_clone(varargs).into_inner(); (args.try_into().expect("bypassed arity check"), varargs) }}; } pub(crate) use unpack_varargs;