From df116bb779fa6bd3922c529674a37736a7f21266 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Thu, 3 Jan 2013 22:34:40 +0900 Subject: [PATCH] Fixing macro environment to be the evaluation, not binding environment, in let-syntax. The difference arises when the same binding is inside and outside the let-syntax. Patch from Zhang Meng. --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eval.c b/eval.c index 2d6ee828..df8cfdb1 100644 --- a/eval.c +++ b/eval.c @@ -828,7 +828,7 @@ static sexp analyze_bind_syntax (sexp ls, sexp eval_ctx, sexp bind_ctx) { else mac = sexp_eval(eval_ctx, sexp_cadar(ls), NULL); if (sexp_procedurep(mac)) - mac = sexp_make_macro(eval_ctx, mac, sexp_context_env(bind_ctx)); + mac = sexp_make_macro(eval_ctx, mac, sexp_context_env(eval_ctx)); if (!(sexp_macrop(mac)||sexp_corep(mac))) { res = (sexp_exceptionp(mac) ? mac : sexp_compile_error(eval_ctx, "non-procedure macro", mac));