some refactorings

This commit is contained in:
2022-01-02 12:45:53 +01:00
parent d3a373ce94
commit ebb69b6096
10 changed files with 57 additions and 54 deletions

8
ml.h
View File

@@ -43,7 +43,7 @@ public:
// Set the value associated with this name in this scope and parent scopes
// and if not exists sets in this scope
void setX(const std::string &name, MlValue value);
void setX(const std::string &name, const MlValue& value);
// Get vector of executables in this scope
std::vector<std::string> get_lambdas_list() const;
@@ -71,7 +71,7 @@ public:
// Create an error with the value that caused the error,
// the scope where the error was found, and the message.
MlError(const MlValue &v, MlEnvironment const &env, const char *msg);
MlError(const MlValue &v, const MlEnvironment &env, const char *msg);
// Copy constructor is needed to prevent double frees
MlError(MlError const &other);
@@ -104,7 +104,7 @@ public:
MlValue(long i);
MlValue(double f);
MlValue(bool b);
MlValue(const std::vector<MlValue> &list); // Constructs a list
MlValue(std::vector<MlValue> list); // Constructs a list
MlValue(const std::vector<std::string> &slist); // Constructs a list from vector of strings
static MlValue quote(const MlValue &quoted); // Construct a quoted value
@@ -136,7 +136,7 @@ public:
std::vector<MlValue> as_list() const;
// Push an item to the end of this list
void push(MlValue val);
void push(const MlValue& val);
// Push an item from the end of this list
MlValue pop();