add macroexpand function. close #46.
This commit is contained in:
parent
17ff153d0e
commit
c4473335b4
11
src/macro.c
11
src/macro.c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue