aboutsummaryrefslogtreecommitdiffstats
path: root/src/cps.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-27 17:51:29 +0000
committerDavid Robillard <d@drobilla.net>2010-12-27 17:51:29 +0000
commit0b014dee824646461b7d402bf9bbcf954ff0eba3 (patch)
tree6e9da06aad29bc641bbc04e181a32e272cc66af8 /src/cps.cpp
parent28e3727290335ee85793795f7ec6d48e050db922 (diff)
downloadresp-0b014dee824646461b7d402bf9bbcf954ff0eba3.tar.gz
resp-0b014dee824646461b7d402bf9bbcf954ff0eba3.tar.bz2
resp-0b014dee824646461b7d402bf9bbcf954ff0eba3.zip
Kill AType.
git-svn-id: http://svn.drobilla.net/resp/resp@359 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/cps.cpp')
-rw-r--r--src/cps.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/cps.cpp b/src/cps.cpp
index 694cbe6..3c4f38d 100644
--- a/src/cps.cpp
+++ b/src/cps.cpp
@@ -29,7 +29,7 @@
static const AST*
cps_value(TEnv& tenv, AST* cont) const
{
- return tup<ATuple>(loc, cont, this, 0);
+ return tup(loc, cont, this, 0);
}
/** (cps (fn (a ...) body) cont) => (cont (fn (a ... k) (cps body k)) */
@@ -39,18 +39,18 @@ cps_fn(TEnv& tenv, AST* cont) const
ATuple* copyProt = new ATuple(*prot());
ASymbol* contArg = tenv.penv.gensym("_k");
copyProt->push_back(contArg);
- AFn* copy = tup<AFn>(loc, tenv.penv.sym("fn"), copyProt, 0);
+ AFn* copy = tup(loc, tenv.penv.sym("fn"), copyProt, 0);
const_iterator p = begin();
++(++p);
for (; p != end(); ++p)
copy->push_back((*p)->(tenv, contArg));
- return tup<ATuple>(loc, cont, copy, 0);
+ return tup(loc, cont, copy, 0);
}
static const AST*
cps_primitive(TEnv& tenv, AST* cont) const
{
- return value() ? tup<ATuple>(loc, cont, this, 0) : ATuple::(tenv, cont);
+ return value() ? tup(loc, cont, this, 0) : ATuple::(tenv, cont);
}
/** (cps (f a b ...)) => (a (fn (x) (b (fn (y) ... (cont (f x y ...)) */
@@ -74,8 +74,8 @@ cps_tuple(TEnv& tenv, AST* cont) const
} else {
arg = tenv.penv.gensym("a");
- AFn* thisFn = tup<AFn>(loc, tenv.penv.sym("fn"),
- tup<ATuple>((*i)->loc, arg, 0),
+ AFn* thisFn = tup(loc, tenv.penv.sym("fn"),
+ tup((*i)->loc, arg, 0),
0);
if (firstFnIter == end()) {
@@ -94,7 +94,7 @@ cps_tuple(TEnv& tenv, AST* cont) const
if (firstFnIter != end()) {
// Call this call's callee in the last argument evaluator
- ATuple* call = tup<ATuple>(loc, 0);
+ ATuple* call = tup(loc, 0);
assert(funcs.size() == size());
for (size_t i = 0; i < funcs.size(); ++i)
call->push_back(funcs[i].second);
@@ -104,7 +104,7 @@ cps_tuple(TEnv& tenv, AST* cont) const
return (*firstFnIter)->(tenv, firstFn);
} else {
assert(head()->value());
- ATuple* ret = tup<ATuple>(loc, 0);
+ ATuple* ret = tup(loc, 0);
FOREACHP(const_iterator, i, this)
ret->push_back((*i));
if (!is_primitive(this))
@@ -120,7 +120,7 @@ cps_def(TEnv& tenv, AST* cont) const
AST* val = body()->(tenv, cont);
ATuple* valCall = val->to_tuple();
ATuple::iterator i = valCall->begin();
- return tup<ADef>(loc, tenv.penv.sym("def"), sym(), *++i, 0);
+ return tup(loc, tenv.penv.sym("def"), sym(), *++i, 0);
}
/** (cps (if c t ... e)) => */
@@ -133,13 +133,13 @@ cps_iff(TEnv& tenv, AST* cont) const
AST* exp = *++i;
AST* next = *++i;
if (cond->value()) {
- return tup<AIf>(loc, tenv.penv.sym("if"), cond,
+ return tup(loc, tenv.penv.sym("if"), cond,
exp->(tenv, cont),
next->(tenv, cont), 0);
} else {
- AFn* contFn = tup<AFn>(loc, tenv.penv.sym("fn"),
- tup<ATuple>(cond->loc, argSym, tenv.penv.gensym("_k"), 0),
- tup<AIf>(loc, tenv.penv.sym("if"), argSym,
+ AFn* contFn = tup(loc, tenv.penv.sym("fn"),
+ tup(cond->loc, argSym, tenv.penv.gensym("_k"), 0),
+ tup(loc, tenv.penv.sym("if"), argSym,
exp->(tenv, cont),
next->(tenv, cont), 0));
return cond->(tenv, contFn);