From 4b70c05fed4ece152eedffc33ed53cb28b74df39 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 15 May 2011 21:19:37 +0000 Subject: 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 --- src/compile.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/compile.cpp') 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 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 == ".") -- cgit v1.2.1