diff options
Diffstat (limited to 'src/lift.cpp')
-rw-r--r-- | src/lift.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lift.cpp b/src/lift.cpp index 3dd0297..939d529 100644 --- a/src/lift.cpp +++ b/src/lift.cpp @@ -119,7 +119,7 @@ AFn::lift(CEnv& cenv, Code& code) throw() AType* implT = new AType(*type); // Type of the implementation function AType* tupT = tup<AType>(loc, cenv.tenv.Tup, cenv.tenv.var(), NULL); AType* consT = tup<AType>(loc, cenv.tenv.Tup, implT, NULL); - ACons* cons = tup<ACons>(loc, cenv.penv.sym("cons"), implName, NULL); // Closure + ACons* cons = tup<ACons>(loc, cenv.penv.sym("Closure"), implName, NULL); *(implT->begin() + 1) = implProtT; @@ -162,10 +162,11 @@ ACall::lift(CEnv& cenv, Code& code) throw() copy->push_front(cenv.penv.sym(cenv.liftStack.top().implName)); } else if (head()->to<AFn*>()) { /* Special case: ((fn ...) ...) - * Lifting (fn ...) yields: (cons _impl ...). - * We don't want ((cons _impl ...) (cons _impl ...) ...), - * so call the implementation function (_impl) directly: - * (_impl (cons _impl ...) ...) + * Lifting (fn ...) yields: (Fn _impl ...). + * We don't want ((Fn _impl ...) (Fn _impl ...) ...), + * so call the implementation function (_impl) directly and pass the + * closure as the first parameter: + * (_impl (Fn _impl ...) ...) */ ACons* closure = (*copy->begin())->as<ACons*>(); ASymbol* implSym = (*(closure->begin() + 1))->as<ASymbol*>(); |