diff options
Diffstat (limited to 'src/expand.cpp')
-rw-r--r-- | src/expand.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/expand.cpp b/src/expand.cpp index bd04e5f..020410e 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -26,7 +26,7 @@ using namespace std; static inline const ATuple* expand_list(PEnv& penv, const ATuple* e) { - List<ATuple, const AST> ret; + List ret; FOREACHP(ATuple::const_iterator, i, e) ret.push_back(penv.expand(*i)); return ret.head; @@ -40,7 +40,7 @@ expand_fn(PEnv& penv, const AST* exp, void* arg) THROW_IF(++a == tup->end(), exp->loc, "Unexpected end of `fn' form"); THROW_IF(!(*a)->to_tuple(), (*a)->loc, "First argument of `fn' is not a list"); const ATuple* prot = (*a++)->to_tuple(); - List<ATuple, const AST> ret(new ATuple(penv.sym("fn"), NULL, exp->loc)); + List ret(new ATuple(penv.sym("fn"), NULL, exp->loc)); ret.push_back(prot); while (a != tup->end()) ret.push_back(penv.expand(*a++)); @@ -62,21 +62,21 @@ expand_def(PEnv& penv, const AST* exp, void* arg) // (def (f x) y) => (def f (fn (x) y)) const ATuple* pat = arg1->to_tuple(); - List<ATuple, const AST> argsExp; + List argsExp; ATuple::const_iterator j = pat->begin(); for (++j; j != pat->end(); ++j) argsExp.push_back(*j); argsExp.head->loc = exp->loc; const AST* body = *(++i); - List<ATuple, const AST> fnExp; + List fnExp; fnExp.push_back(penv.sym("fn")); fnExp.push_back(argsExp.head); for (; i != tup->end(); ++i) fnExp.push_back(*i); fnExp.head->loc = body->loc; - List<ATuple, const AST> ret; + List ret; ret.push_back(tup->head()); ret.push_back(pat->head()); ret.push_back(fnExp.head); @@ -113,10 +113,10 @@ initLang(PEnv& penv, TEnv& tenv) { // Types const char* types[] = { - "Bool", "Float", "Int", "Lexeme", "Nothing", "Quote", "String", 0 }; + "Bool", "Float", "Int", "Nothing", "Quote", "String", 0 }; for (const char** t = types; *t; ++t) { const ASymbol* sym = penv.sym(*t); - tenv.def(sym, new AType(sym, AType::NAME)); + tenv.def(sym, sym); // FIXME: define to NULL? } const char* primitives[] = { |