/** @file BuiltinPrimitives.hpp * * @author Roland Conybeare, Nov 2025 **/ #include "xo/object/ObjectConverter.hpp" #include "xo/allocutil/IAlloc.hpp" #include "Primitive.hpp" #include "GlobalEnv.hpp" namespace xo { namespace scm { struct BuiltinPrimitives { public: using ObjectConverter = xo::obj::ObjectConverter; template static void install_pm(gc::IAlloc * mm, rp pm_expr, gp env) { gp rhs = xo::obj::make_primitive(mm, pm_expr->name(), pm_expr->value()); /* store in env using this variable-expr */ rp lhs = Variable::make(pm_expr->name(), pm_expr->value_td()); gp * addr = env->establish_var(lhs.borrow()); *addr = rhs; } static void install(gc::IAlloc * mm, gp env); }; } } /* end BuiltinPrimitives.hpp */