setX starts searching in current scope

This commit is contained in:
VaclavT 2021-05-03 18:30:01 +02:00
parent 78f870c17d
commit 0829f965be
1 changed files with 1 additions and 1 deletions

2
ml.cpp
View File

@ -655,7 +655,7 @@ void MlEnvironment::set(const std::string &name, MlValue value) {
void MlEnvironment::setX(const std::string &name, MlValue value) {
MlEnvironment* e = this->parent_scope; // we start above this scope for set!
MlEnvironment* e = this;
while (e != nullptr) {
std::map<std::string, MlValue>::const_iterator itr = e->defs.find(name);
if (itr != e->defs.end()) {