aboutsummaryrefslogtreecommitdiff
path: root/c/step8_macros.c
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-23 21:59:50 -0500
committerJoel Martin <github@martintribe.org>2014-04-23 21:59:50 -0500
commit6301e0b6374cecc5599665be14d6ddc6a31ce1e8 (patch)
treedbf1dc2ff6c682fd87c72a7907e7f6e59c8d4c03 /c/step8_macros.c
parent89bd4de1e2704c1bc562788b2c5e4fc08b71a538 (diff)
downloadmal-6301e0b6374cecc5599665be14d6ddc6a31ce1e8.tar.gz
mal-6301e0b6374cecc5599665be14d6ddc6a31ce1e8.zip
All: TCO let* and quasiquote.
Diffstat (limited to 'c/step8_macros.c')
-rw-r--r--c/step8_macros.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/c/step8_macros.c b/c/step8_macros.c
index e7aebf2..3558caf 100644
--- a/c/step8_macros.c
+++ b/c/step8_macros.c
@@ -152,7 +152,9 @@ MalVal *EVAL(MalVal *ast, Env *env) {
assert_type(key, MAL_SYMBOL, "let* bind to non-symbol");
env_set(let_env, key->val.string, EVAL(val, let_env));
}
- return EVAL(a2, let_env);
+ ast = a2;
+ env = let_env;
+ // Continue loop
} else if ((a0->type & MAL_SYMBOL) &&
strcmp("quote", a0->val.string) == 0) {
//g_print("eval apply quote\n");
@@ -161,7 +163,8 @@ MalVal *EVAL(MalVal *ast, Env *env) {
strcmp("quasiquote", a0->val.string) == 0) {
//g_print("eval apply quasiquote\n");
MalVal *a1 = _nth(ast, 1);
- return EVAL(quasiquote(a1), env);
+ ast = quasiquote(a1);
+ // Continue loop
} else if ((a0->type & MAL_SYMBOL) &&
strcmp("defmacro!", a0->val.string) == 0) {
//g_print("eval apply defmacro!\n");