aboutsummaryrefslogtreecommitdiffstats
path: root/src/compile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compile.cpp')
-rw-r--r--src/compile.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compile.cpp b/src/compile.cpp
index e8e06b8..9a7162f 100644
--- a/src/compile.cpp
+++ b/src/compile.cpp
@@ -51,8 +51,8 @@ ACall::compile(CEnv& cenv)
if (!c) return NULL; // Primitive
AType protT(loc);
- for (size_t i = 1; i < size(); ++i)
- protT.push_back(cenv.type(at(i)));
+ for (const_iterator i = begin() + 1; i != end(); ++i)
+ protT.push_back(cenv.type(*i));
AType fnT(loc);
fnT.push_back(cenv.penv.sym("Fn"));
@@ -63,8 +63,9 @@ ACall::compile(CEnv& cenv)
THROW_IF(!f, loc, (format("callee failed to compile for type %1%") % fnT.str()).str());
vector<CVal> args(size() - 1);
+ const_iterator e = begin() + 1;
for (size_t i = 0; i < args.size(); ++i)
- args[i] = at(i + 1)->compile(cenv);
+ args[i] = (*e++)->compile(cenv);
return cenv.engine()->compileCall(cenv, f, args);
}
@@ -73,8 +74,8 @@ CVal
ADef::compile(CEnv& cenv)
{
// Define stub first for recursion
- cenv.def(sym(), at(2), cenv.type(at(2)), NULL);
- CVal val = at(size() - 1)->compile(cenv);
+ cenv.def(sym(), body(), cenv.type(body()), NULL);
+ CVal val = body()->compile(cenv);
cenv.vals.def(sym(), val);
return val;
}