aboutsummaryrefslogtreecommitdiff
path: root/c/step6_file.c
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-02 22:23:37 -0500
committerJoel Martin <github@martintribe.org>2014-04-02 22:23:37 -0500
commitea81a8087bcd7953b083a2be9db447f75e7ebf56 (patch)
tree6cf47a2dbd55d42efc4a901eaabdec952f40ce89 /c/step6_file.c
parent1617910ad342a55762f3ddabb975849d843cff85 (diff)
downloadmal-ea81a8087bcd7953b083a2be9db447f75e7ebf56.tar.gz
mal-ea81a8087bcd7953b083a2be9db447f75e7ebf56.zip
All: split types into types, env, printer, core.
- types: low-level mapping to the implementation language. - core: functions on types that are exposed directly to mal. - printer: implementation called by pr-str, str, prn, println. - env: the environment implementation - Also, unindent all TCO while loops so that the diff of step4 and step5 are minimized.
Diffstat (limited to 'c/step6_file.c')
-rw-r--r--c/step6_file.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/c/step6_file.c b/c/step6_file.c
index bfd81fd..acde758 100644
--- a/c/step6_file.c
+++ b/c/step6_file.c
@@ -6,6 +6,7 @@
#include "types.h"
#include "readline.h"
#include "reader.h"
+#include "core.h"
#include "interop.h"
// Declarations
@@ -147,7 +148,7 @@ MalVal *EVAL(MalVal *ast, Env *env) {
env = new_env(f->val.func.env, f->val.func.args, args);
// Continue loop
} else {
- return apply(f, args);
+ return _apply(f, args);
}
}
}
@@ -209,9 +210,9 @@ void init_repl_env() {
repl_env = new_env(NULL, NULL, NULL);
int i;
- for(i=0; i< (sizeof(types_ns) / sizeof(types_ns[0])); i++) {
- MalVal *(*f)(MalVal *) = (MalVal*(*)(MalVal*))types_ns[i].func;
- _ref(types_ns[i].name, f, types_ns[i].arg_cnt);
+ for(i=0; i< (sizeof(core_ns) / sizeof(core_ns[0])); i++) {
+ MalVal *(*f)(MalVal *) = (MalVal*(*)(MalVal*))core_ns[i].func;
+ _ref(core_ns[i].name, f, core_ns[i].arg_cnt);
}
MalVal *read_string(MalVal *str) {