use crate::eval::coercion::to_bool;
use crate::eval::functions::check_arity;
use crate::types::Value;
pub fn not_fn(args: &[Value]) -> Value {
if let Some(err) = check_arity(args, 1, 1) {
return err;
}
match to_bool(args[0].clone()) {
Ok(b) => Value::Bool(!b),
Err(e) => e,
}
}
#[cfg(test)]
mod tests;