From 57253f9a6c4d586f9a3207b481c06aef4f08ee77 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Fri, 10 Jan 2014 17:52:31 +0900 Subject: [PATCH] compare is allowed to take non-symbol values --- src/macro.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/macro.c b/src/macro.c index ee91b61c..15cff9a1 100644 --- a/src/macro.c +++ b/src/macro.c @@ -675,16 +675,18 @@ er_macro_rename(pic_state *pic) static pic_value er_macro_compare(pic_state *pic) { - pic_sym x, y; - struct pic_senv *use_env; pic_value a, b; + struct pic_senv *use_env; - pic_get_args(pic, "mm", &x, &y); + pic_get_args(pic, "oo", &a, &b); + + if (! pic_symbol_p(a) || ! pic_symbol_p(b)) + return pic_false_value(); /* should be an error? */ use_env = pic_senv_ptr(pic_proc_cv_ref(pic, pic_get_proc(pic), 0)); - a = macroexpand(pic, pic_symbol_value(x), use_env); - b = macroexpand(pic, pic_symbol_value(y), use_env); + a = macroexpand(pic, a, use_env); + b = macroexpand(pic, b, use_env); return pic_bool_value(pic_eq_p(a, b)); }