setX starts searching in current scope
This commit is contained in:
parent
78f870c17d
commit
0829f965be
2
ml.cpp
2
ml.cpp
|
|
@ -655,7 +655,7 @@ void MlEnvironment::set(const std::string &name, MlValue value) {
|
||||||
|
|
||||||
|
|
||||||
void MlEnvironment::setX(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) {
|
while (e != nullptr) {
|
||||||
std::map<std::string, MlValue>::const_iterator itr = e->defs.find(name);
|
std::map<std::string, MlValue>::const_iterator itr = e->defs.find(name);
|
||||||
if (itr != e->defs.end()) {
|
if (itr != e->defs.end()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue