lambda capture restored

This commit is contained in:
VaclavT 2021-04-22 22:48:10 +02:00
parent 13e5097f3a
commit b8d9690141
1 changed files with 6 additions and 6 deletions

12
ml.cpp
View File

@ -111,12 +111,12 @@ MlValue::MlValue(const std::vector<MlValue> &params, MlValue ret, MlEnvironment
list.push_back(ret); list.push_back(ret);
// // Lambdas capture only variables that they know they will use. // // Lambdas capture only variables that they know they will use.
// std::vector<std::string> used_atoms = ret.get_used_atoms(); std::vector<std::string> used_atoms = ret.get_used_atoms();
// for (size_t i = 0; i < used_atoms.size(); i++) { for (size_t i = 0; i < used_atoms.size(); i++) {
// // If the environment has a symbol that this lambda uses, capture it. // If the environment has a symbol that this lambda uses, capture it.
// if (env.has(used_atoms[i])) if (env.has(used_atoms[i]))
// lambda_scope.set(used_atoms[i], env.get(used_atoms[i])); lambda_scope.set(used_atoms[i], env.get(used_atoms[i]));
// } }
} }
// Construct a builtin function // Construct a builtin function