detailed stracktrace only when option -d, second implemented in c++

This commit is contained in:
2021-10-11 12:04:49 +02:00
parent b68987fdd7
commit ecbc3af789
6 changed files with 38 additions and 47 deletions

32
ml.h
View File

@@ -58,7 +58,6 @@ public:
friend std::ostream &operator<<(std::ostream &os, MlEnvironment const &v);
private:
// The definitions in the scope.
std::map<std::string, MlValue> defs;
MlEnvironment *parent_scope;
@@ -97,40 +96,21 @@ typedef MlValue (*Builtin)(std::vector<MlValue>, MlEnvironment &);
class MlPerfMon;
class MlValue {
public:
// Constructs a nil value
MlValue();
// Constructs an integer
MlValue(); // Constructs a nil value
MlValue(long i);
// Constructs a floating point value
MlValue(double f);
// Constructs a bool value
MlValue(bool b);
MlValue(const std::vector<MlValue> &list); // Constructs a list
// Constructs a list
MlValue(const std::vector<MlValue> &list);
// Construct a quoted value
static MlValue quote(const MlValue &quoted);
// Construct an atom
static MlValue quote(const MlValue &quoted); // Construct a quoted value
static MlValue atom(const std::string &s);
// Construct a string
static MlValue string(const std::string &s);
// Construct a nil
static MlValue nil();
// Construct a lambda function
MlValue(const std::vector<MlValue> &params, MlValue ret, MlEnvironment const &env);
// Construct a builtin function
MlValue(const std::string &name, Builtin b);
MlValue(const std::vector<MlValue> &params, MlValue ret, MlEnvironment const &env); // Construct a lambda function
MlValue(const std::string &name, Builtin b); // Construct a builtin function
std::vector<std::string> get_used_atoms();