//! Computational utility functions. mod color; mod math; mod string; pub use color::*; pub use math::*; pub use string::*; use crate::library::prelude::*; /// The name of a value's type. pub fn type_(_: &mut Context, args: &mut Args) -> TypResult { Ok(args.expect::("value")?.type_name().into()) } /// Ensure that a condition is fulfilled. pub fn assert(_: &mut Context, args: &mut Args) -> TypResult { let Spanned { v, span } = args.expect::>("condition")?; if !v { bail!(span, "assertion failed"); } Ok(Value::None) }