1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#[derive(Clone, Debug, PartialEq)] pub enum Value { Nil, Bool(bool), Number(f64), } impl Value { pub fn is_falsey(&self) -> bool { match self { Value::Nil => true, Value::Bool(false) => true, _ => false, } } }