add macroexpand function. close #46.

This commit is contained in:
Yuichi Nishiwaki 2014-02-15 13:02:06 +09:00
parent 17ff153d0e
commit c4473335b4
1 changed files with 11 additions and 0 deletions

View File

@ -649,6 +649,16 @@ pic_macro_gensym(pic_state *pic)
return pic_symbol_value(uniq);
}
static pic_value
pic_macro_macroexpand(pic_state *pic)
{
pic_value expr;
pic_get_args(pic, "o", &expr);
return pic_macroexpand(pic, expr);
}
static pic_value
pic_macro_make_sc(pic_state *pic)
{
@ -911,6 +921,7 @@ pic_init_macro(pic_state *pic)
pic_export(pic, pic->sDEFINE_MACRO);
pic_defun(pic, "gensym", pic_macro_gensym);
pic_defun(pic, "macroexpand", pic_macro_macroexpand);
pic_defun(pic, "make-syntactic-closure", pic_macro_make_sc);
pic_defun(pic, "identifier?", pic_macro_identifier_p);
pic_defun(pic, "identifier=?", pic_macro_identifier_eq_p);