pass as reference

This commit is contained in:
VaclavT 2021-04-14 07:55:33 +02:00
parent e0574837b6
commit c95d7ec886
3 changed files with 2 additions and 3 deletions

View File

@ -37,7 +37,6 @@
- get-env, set-env; set-env cannot be implemented in stdlib.lsp, because popen is in fact subshell
- format (sprintf)
- setq
- mapcar (funcall, apply)
- syntax highlighting do VS Code
- add hash datatype

2
ml.cpp
View File

@ -1768,7 +1768,7 @@ void load_std_lib(MlEnvironment &env) {
}
// Does this environment, or its parent environment, have a variable?
bool MlEnvironment::has(std::string name) const {
bool MlEnvironment::has(const std::string &name) const {
// Find the value in the map
std::map<std::string, MlValue>::const_iterator itr = defs.find(name);
if (itr != defs.end())

2
ml.h
View File

@ -34,7 +34,7 @@ public:
// have this atom in scope?
// This is only used to determine which atoms to capture when
// creating a lambda function.
bool has(std::string name) const;
bool has(const std::string &name) const;
// Get the value associated with this name in this scope
MlValue get(const std::string &name) const;