aboutsummaryrefslogtreecommitdiffstats
path: root/src/flatten.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/flatten.cpp')
-rw-r--r--src/flatten.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/flatten.cpp b/src/flatten.cpp
index 424e5a6..ca849fa 100644
--- a/src/flatten.cpp
+++ b/src/flatten.cpp
@@ -32,7 +32,7 @@ flatten_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);
- if (!is_form(body, "fn")) {
+ if (!is_form(body, "lambda")) {
code.push_back(def);
return NULL;
}
@@ -89,7 +89,7 @@ flatten_do(CEnv& cenv, Code& code, const ATuple* ado) throw()
code.push_back(ret);
}
const ASymbol* sym = cenv.penv.gensym("doval");
- List def(Cursor(), cenv.penv.sym("def"), sym, ret, NULL);
+ List def(Cursor(), cenv.penv.sym("define"), sym, ret, NULL);
code.push_back(def);
cenv.setTypeSameAs(sym, ado);
return sym;
@@ -103,7 +103,7 @@ flatten_if(CEnv& cenv, Code& code, const ATuple* aif) throw()
cond = aif->frst()->as_symbol();
} else {
cond = cenv.penv.gensym("ifcond");
- List def(Cursor(), cenv.penv.sym("def"), cond,
+ List def(Cursor(), cenv.penv.sym("define"), cond,
resp_flatten(cenv, code, aif->frst()), 0);
cenv.setTypeSameAs(cond, aif->frst());
code.push_back(def);
@@ -131,7 +131,7 @@ flatten_if(CEnv& cenv, Code& code, const ATuple* aif) throw()
code.push_back(else_goto);
List end(Cursor(), cenv.penv.sym("if-end"), if_lab, NULL);
- List def(Cursor(), cenv.penv.sym("def"), result, end.head, NULL);
+ List def(Cursor(), cenv.penv.sym("define"), result, end.head, NULL);
code.push_back(def);
cenv.setTypeSameAs(end, aif);
@@ -150,7 +150,7 @@ flatten_call(CEnv& cenv, Code& code, const ATuple* call) throw()
arg = flat_i;
} else {
const ASymbol* sym = cenv.penv.gensym();
- List def(Cursor(), cenv.penv.sym("def"), sym, flat_i, NULL);
+ List def(Cursor(), cenv.penv.sym("define"), sym, flat_i, NULL);
code.push_back(def);
arg = sym;
cenv.setTypeSameAs(sym, *i);
@@ -159,7 +159,7 @@ flatten_call(CEnv& cenv, Code& code, const ATuple* call) throw()
copy.push_back(arg);
}
const ASymbol* sym = cenv.penv.gensym();
- List def(Cursor(), cenv.penv.sym("def"), sym, copy.head, NULL);
+ List def(Cursor(), cenv.penv.sym("define"), sym, copy.head, NULL);
code.push_back(def);
cenv.setTypeSameAs(copy, call);
@@ -175,10 +175,10 @@ resp_flatten(CEnv& cenv, Code& code, const AST* ast) throw()
const ATuple* const call = ast->as_tuple();
const ASymbol* const sym = call->fst()->to_symbol();
const std::string form = sym ? sym->sym() : "";
- assert(form != "fn");
+ assert(form != "lambda");
if (form == "quote")
return ast;
- else if (form == "def")
+ else if (form == "define")
return flatten_def(cenv, code, call);
else if (form == "def-type")
return flatten_def_type(cenv, code, call);