diff options
author | David Robillard <d@drobilla.net> | 2011-05-15 21:19:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-15 21:19:37 +0000 |
commit | 4b70c05fed4ece152eedffc33ed53cb28b74df39 (patch) | |
tree | e97c15f48a7b9ebd7e7f2fecedfdd844a8be0210 /src/compile.cpp | |
parent | 8cbb1c710d6c8877dfc2871dc3f068b52598a884 (diff) | |
download | resp-4b70c05fed4ece152eedffc33ed53cb28b74df39.tar.gz resp-4b70c05fed4ece152eedffc33ed53cb28b74df39.tar.bz2 resp-4b70c05fed4ece152eedffc33ed53cb28b74df39.zip |
Remove cast form (unnecessary since compile stage casts paramters as needed anyway).
git-svn-id: http://svn.drobilla.net/resp/trunk@428 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/compile.cpp')
-rw-r--r-- | src/compile.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/compile.cpp b/src/compile.cpp index f84d789..244fcc6 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -140,12 +140,11 @@ compile_call(CEnv& cenv, const ATuple* call) throw() CFunc f = resp_compile(cenv, call->fst()); vector<CVal> args; - ATuple::const_iterator t = protT->iter_at(0); - for (ATuple::const_iterator e = call->iter_at(1); e != call->end(); ++e, ++t) { - CVal arg = resp_compile(cenv, *e); - if ((*e)->to_symbol() && (cenv.type(*e) != cenv.type(*t))) { - - args.push_back(cenv.engine()->compileCast(cenv, arg, *t)); + ATuple::const_iterator p = protT->iter_at(0); + for (ATuple::const_iterator a = call->iter_at(1); a != call->end(); ++a, ++p) { + CVal arg = resp_compile(cenv, *a); + if (cenv.type(*a) != cenv.resolveType(*p)) { + args.push_back(cenv.engine()->compileCast(cenv, arg, *p)); } else { args.push_back(arg); } @@ -207,10 +206,6 @@ resp_compile(CEnv& cenv, const AST* ast) throw() const std::string form = sym ? sym->sym() : ""; if (is_primitive(cenv.penv, call)) return cenv.engine()->compilePrimitive(cenv, ast->as_tuple()); - else if (form == "cast") - return cenv.engine()->compileCast(cenv, - resp_compile(cenv, call->frst()), - cenv.type(call)); else if (form == "cons" || isupper(form[0])) return compile_cons(cenv, call); else if (form == ".") |