diff options
author | David Robillard <d@drobilla.net> | 2012-12-23 05:31:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-12-23 05:31:15 +0000 |
commit | 67319bf0410196787c753225f46057bc7c94beec (patch) | |
tree | 572e8f8989a903fde8be784de5dddbaa1938ecfe /src/lift.cpp | |
parent | 0375a20786f1e6eba9d128889f700b22d447021c (diff) | |
download | resp-67319bf0410196787c753225f46057bc7c94beec.tar.gz resp-67319bf0410196787c753225f46057bc7c94beec.tar.bz2 resp-67319bf0410196787c753225f46057bc7c94beec.zip |
Move towards standard Scheme syntax.
git-svn-id: http://svn.drobilla.net/resp/trunk@442 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/lift.cpp')
-rw-r--r-- | src/lift.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lift.cpp b/src/lift.cpp index 7f236d1..7fa834f 100644 --- a/src/lift.cpp +++ b/src/lift.cpp @@ -76,7 +76,7 @@ lift_def(CEnv& cenv, Code& code, const ATuple* def) throw() const ASymbol* const sym = def->list_ref(1)->as_symbol(); const AST* const body = def->list_ref(2); cenv.def(sym, body, cenv.type(body), NULL); - if (is_form(body, "fn")) + if (is_form(body, "lambda")) cenv.setName(body->as_tuple(), sym->str()); assert(def->list_ref(1)->to_symbol()); @@ -126,7 +126,7 @@ lift_fn(CEnv& cenv, Code& code, const ATuple* fn) throw() for (ATuple::const_iterator p = fn->prot()->begin(); p != fn->prot()->end(); ++p) { const AST* paramType = (*tp++); - if (is_form(paramType, "Fn")) { + if (is_form(paramType, "lambda")) { const ATuple* fnType = new ATuple(cenv.tenv.var(), paramType->as_tuple(), paramType->loc); paramType = tup((*p)->loc, cenv.tenv.Tup, fnType, NULL); } @@ -136,7 +136,7 @@ lift_fn(CEnv& cenv, Code& code, const ATuple* fn) throw() } // Write function prototype first for mutual and/or nested recursion - List declProt(fn->loc, cenv.penv.sym("fn"), 0); + List declProt(fn->loc, cenv.penv.sym("lambda"), 0); declProt.push_back(implProt); List decl(fn->loc, cenv.penv.sym("prot"), cenv.penv.sym(implNameStr), 0); decl.push_back(declProt); @@ -157,7 +157,7 @@ lift_fn(CEnv& cenv, Code& code, const ATuple* fn) throw() // Create definition for implementation fn const ASymbol* implName = cenv.penv.sym(implNameStr); - const ATuple* def = tup(fn->loc, cenv.penv.sym("def"), implName, impl.head, NULL); + const ATuple* def = tup(fn->loc, cenv.penv.sym("define"), implName, impl.head, NULL); // Define types before lifting body with return type as a variable List implT(Cursor(), type->fst(), implProtT.head, retTVar, 0); @@ -244,7 +244,7 @@ lift_call(CEnv& cenv, Code& code, const ATuple* call) throw() 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")) { + } else if (is_form(call->fst(), "lambda")) { /* Special case: ((fn ...) ...) * Lifting (fn ...) yields: (Closure _impl ...). * We don't want (call (. (Closure _impl ...) 1) (Closure _impl ...) ...), @@ -307,13 +307,13 @@ resp_lift(CEnv& cenv, Code& code, const AST* ast) throw() return lift_args(cenv, code, call); else if (form == ".") return lift_dot(cenv, code, call); - else if (form == "def") + else if (form == "define") return lift_def(cenv, code, call); else if (form == "def-type") return call; else if (form == "do") return lift_args(cenv, code, call); - else if (form == "fn") + else if (form == "lambda") return lift_fn(cenv, code, call); else if (form == "if") return lift_args(cenv, code, call); |