1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-11 00:52:44 +03:00
mal/cpp/Environment.h
Stephen Thirlwall ad50bab2e5 c++11: step 6
2015-03-27 20:44:42 +11:00

30 lines
633 B
C++

#ifndef INCLUDE_ENVIRONMENT_H
#define INCLUDE_ENVIRONMENT_H
#include "MAL.h"
#include <map>
class malEnv : public RefCounted {
public:
malEnv(malEnvPtr outer = NULL);
malEnv(malEnvPtr outer,
const StringVec& bindings,
malValueIter argsBegin,
malValueIter argsEnd);
~malEnv();
malValuePtr get(const String& symbol);
malEnvPtr find(const String& symbol);
malValuePtr set(const String& symbol, malValuePtr value);
malEnvPtr getRoot();
private:
typedef std::map<String, malValuePtr> Map;
Map m_map;
malEnvPtr m_outer;
};
#endif // INCLUDE_ENVIRONMENT_H