aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compile.cpp9
-rw-r--r--src/resp.hpp3
2 files changed, 7 insertions, 5 deletions
diff --git a/src/compile.cpp b/src/compile.cpp
index 53fd9ad..44017ec 100644
--- a/src/compile.cpp
+++ b/src/compile.cpp
@@ -39,15 +39,14 @@ compile_symbol(CEnv& cenv, const ASymbol* sym) throw()
static CVal
compile_literal_symbol(CEnv& cenv, const ASymbol* sym) throw()
{
- CVal* existing = cenv.vals.ref(sym);
- if (existing) {
- return *existing;
+ CEnv::CSyms::iterator i = cenv.cSyms.find(sym->sym());
+ if (i != cenv.cSyms.end()) {
+ return i->second;
} else {
CVal compiled = cenv.engine()->compileString(cenv, sym->sym());
- cenv.vals.def(sym, compiled);
+ cenv.cSyms.insert(make_pair(sym->sym(), compiled));
return compiled;
}
-
}
static CVal
diff --git a/src/resp.hpp b/src/resp.hpp
index 4217f6d..7de26d8 100644
--- a/src/resp.hpp
+++ b/src/resp.hpp
@@ -777,6 +777,9 @@ struct CEnv {
map<string,string> args;
+ typedef map<const char*, CVal> CSyms;
+ CSyms cSyms;
+
CFunc currentFn; ///< Currently compiling function
bool repl;