c++11: step 2
[jackhill/mal.git] / cpp / Environment.cpp
1 #include "Environment.h"
2 #include "Types.h"
3
4 #include <algorithm>
5
6 malValuePtr malEnv::get(const String& symbol)
7 {
8 auto it = m_map.find(symbol);
9 if (it != m_map.end()) {
10 return it->second;
11 }
12 ASSERT(false, "'%s' not found", symbol.c_str());
13 }
14
15 malValuePtr malEnv::set(const String& symbol, malValuePtr value)
16 {
17 m_map[symbol] = value;
18 return value;
19 }