diff options
author | Ben Burdette <bburdette@gmail.com> | 2021-12-27 14:06:04 -0700 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2021-12-27 14:06:04 -0700 |
commit | ff82ba98b41eb3e4b1ce96ed02504acea03eb29c (patch) | |
tree | 334f3c0bb4185054ed9f10775ae0a75f835a8076 /src/libexpr/eval.cc | |
parent | d0d589044512a77b345b7e576e2c45910c74eb02 (diff) |
don't add builtins to extras, initEnv() in regular repl
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r-- | src/libexpr/eval.cc | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 377e1b2f8..d99e73471 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -715,8 +715,9 @@ void mapStaticEnvBindings(const StaticEnv &se, const Env &env, valmap & vm) { // add bindings for the next level up first, so that the bindings for this level // override the higher levels. + // The top level bindings (builtins) are skipped since they are added for us by initEnv() if (env.up && se.up) { - mapStaticEnvBindings( *se.up, *env.up,vm); + mapStaticEnvBindings(*se.up, *env.up,vm); // iterate through staticenv bindings and add them. auto map = valmap(); @@ -727,23 +728,6 @@ void mapStaticEnvBindings(const StaticEnv &se, const Env &env, valmap & vm) vm.merge(map); } - else - { - std::cout << " -------------------- " << std::endl; - // iterate through staticenv bindings and add them, - // except for the __* ones. - auto map = valmap(); - for (auto iter = se.vars.begin(); iter != se.vars.end(); ++iter) - { - std::cout << iter->first << std::endl; - std::string s = iter->first; - if (s.substr(0,2) != "__") { - map[iter->first] = env.values[iter->second]; - } - } - - vm.merge(map); - } } |