setX starts searching in current scope
This commit is contained in:
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()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user