From c4040949ff5c288a0cc41e752d1ebf0e6f96c02b Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Fri, 7 Feb 2014 02:14:39 +0900 Subject: [PATCH] stop warning in macroexpand, and creating a duplicate slot --- src/macro.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/macro.c b/src/macro.c index 69ce6c87..b4e91bb0 100644 --- a/src/macro.c +++ b/src/macro.c @@ -496,11 +496,11 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv) if (! pic_sym_p(var)) { pic_error(pic, "binding to non-symbol object"); } - uniq = pic_gensym(pic, pic_sym(var)); - if (xh_get_int(senv->tbl, pic_sym(var)) != NULL) { - pic_warn(pic, "redefining variable"); + /* do not make duplicate variable slot*/ + if (xh_get_int(senv->tbl, pic_sym(var)) == NULL) { + uniq = pic_gensym(pic, pic_sym(var)); + xh_put_int(senv->tbl, pic_sym(var), (int)uniq); } - xh_put_int(senv->tbl, pic_sym(var), (int)uniq); } FALLTHROUGH; case PIC_STX_SET: