diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-23 21:59:50 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-23 21:59:50 -0500 |
| commit | 6301e0b6374cecc5599665be14d6ddc6a31ce1e8 (patch) | |
| tree | dbf1dc2ff6c682fd87c72a7907e7f6e59c8d4c03 /c/step8_macros.c | |
| parent | 89bd4de1e2704c1bc562788b2c5e4fc08b71a538 (diff) | |
| download | mal-6301e0b6374cecc5599665be14d6ddc6a31ce1e8.tar.gz mal-6301e0b6374cecc5599665be14d6ddc6a31ce1e8.zip | |
All: TCO let* and quasiquote.
Diffstat (limited to 'c/step8_macros.c')
| -rw-r--r-- | c/step8_macros.c | 7 |
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"); |
