diff --git a/src/builtin/meta.rs b/src/builtin/meta.rs index 76e6b79..edc0e02 100644 --- a/src/builtin/meta.rs +++ b/src/builtin/meta.rs @@ -1,6 +1,6 @@ use std::collections::BTreeMap; -use super::Builtin; +use super::{Builtin, GLOBAL_FUNCTIONS}; use crate::common::QuoteKind; use crate::units::Unit; use crate::value::Value; @@ -71,7 +71,8 @@ pub(crate) fn register(f: &mut BTreeMap) { }); decl!(f "function-exists", |args, scope| { let value = arg!(args, 0, "name"); - Some(Value::bool(scope.fn_exists(&value.to_string()))) + let s = value.eval().unquote().to_string(); + Some(Value::bool(scope.fn_exists(&s) || GLOBAL_FUNCTIONS.contains_key(&s))) }); decl!(f "call", |_args, _scope| { todo!("builtin function `call()` is blocked on refactoring how call args are stored and parsed")