diff --git a/include/xo/interpreter2/VirtualSchematikaMachine.hpp b/include/xo/interpreter2/VirtualSchematikaMachine.hpp index ec7eda34..6663538e 100644 --- a/include/xo/interpreter2/VirtualSchematikaMachine.hpp +++ b/include/xo/interpreter2/VirtualSchematikaMachine.hpp @@ -280,7 +280,7 @@ namespace xo { obj expr_; /** environment pointer. Maintains bindings - * for global variables. + * for global variables. Obtained from reader **/ DGlobalEnv * global_env_ = nullptr; diff --git a/src/interpreter2/VirtualSchematikaMachine.cpp b/src/interpreter2/VirtualSchematikaMachine.cpp index 6bcbe8bf..a4ed2810 100644 --- a/src/interpreter2/VirtualSchematikaMachine.cpp +++ b/src/interpreter2/VirtualSchematikaMachine.cpp @@ -86,7 +86,7 @@ namespace xo { this->error_mm_.adopt(obj(arena)); } - this->global_env_ = DGlobalEnv::_make(mm_.to_op(), reader_.global_symtab()); + this->global_env_ = reader_.global_env(); this->install_core_primitives(); } @@ -915,26 +915,6 @@ namespace xo { static DPrimitive_gco_0 s_cwd_pm("_cwd", &xfer_cwd); - // ----- primitive: nth() ----- - - // TODO: seq_gc -> obj - // n_gco -> obj - // - obj - xfer_nth(obj rcx, - obj seq_gco, - obj n_gco) - { - (void)rcx; - - obj seq = seq_gco.to_facet(); - auto n = obj::from(n_gco); - - return seq.at(n->value()); - } - - static DPrimitive_gco_2_gco_gco s_nth_pm("_nth", &xfer_nth); - // ----- primitive: cons() ----- obj @@ -1045,18 +1025,6 @@ namespace xo { obj(&s_cwd_pm)); } - /* nth */ - { - const DUniqueString * name - = reader_.intern_string("nth"); - - global_env_->_upsert_value - (mm_.to_op(), - name, - Reflect::require(), - obj(&s_nth_pm)); - } - /* cons */ { const DUniqueString * name