diff options
Diffstat (limited to 'src/lift.cpp')
-rw-r--r-- | src/lift.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lift.cpp b/src/lift.cpp index 1d4e19c..802130d 100644 --- a/src/lift.cpp +++ b/src/lift.cpp @@ -213,19 +213,21 @@ lift_call(CEnv& cenv, Code& code, const ATuple* call) throw() * reusing the current "_me" closure parameter (no cons or .). */ copy.push_front(cenv.penv.sym(cenv.liftStack.top().implName)); + copy.push_front(cenv.penv.sym("call")); cenv.setTypeSameAs(copy, call); } else if (is_form(call->fst(), "fn")) { /* Special case: ((fn ...) ...) - * Lifting (fn ...) yields: (Fn _impl ...). - * We don't want ((Fn _impl ...) (Fn _impl ...) ...), + * Lifting (fn ...) yields: (Closure _impl ...). + * We don't want (call (. (Closure _impl ...) 1) (Closure _impl ...) ...), * so call the implementation function (_impl) directly and pass the * closure as the first parameter: - * (_impl (Fn _impl ...) ...) + * (call _impl (Closure _impl ...) ...) */ const ATuple* closure = copy.head->list_ref(0)->as_tuple(); const ASymbol* implSym = closure->list_ref(1)->as_symbol(); const ATuple* implT = cenv.type(cenv.resolve(implSym))->as_tuple(); copy.push_front(implSym); + copy.push_front(cenv.penv.sym("call")); cenv.setType(copy, implT->list_ref(2)); } else { // Call to a closure, prepend code to access implementation function @@ -237,6 +239,7 @@ lift_call(CEnv& cenv, Code& code, const ATuple* call) throw() const ATuple* implT = calleeT->list_ref(1)->as_tuple(); copy.push_front(getFn); cenv.setType(getFn, implT); + copy.push_front(cenv.penv.sym("call")); cenv.setType(copy, implT->list_ref(2)); } |