publish ungensym

This commit is contained in:
Yuichi Nishiwaki 2014-07-26 14:10:17 +09:00
parent 5ba0c56308
commit b4a0761eb3
2 changed files with 12 additions and 0 deletions

View File

@ -49,6 +49,7 @@ Utility functions and syntaces for macro definition.
- define-macro - define-macro
- gensym - gensym
- ungensym
- macroexpand - macroexpand
- macroexpand-1 - macroexpand-1

View File

@ -577,6 +577,16 @@ pic_macro_gensym(pic_state *pic)
return pic_sym_value(uniq); return pic_sym_value(uniq);
} }
static pic_value
pic_macro_ungensym(pic_state *pic)
{
pic_sym sym;
pic_get_args(pic, "m", &sym);
return pic_sym_value(pic_ungensym(pic, sym));
}
static pic_value static pic_value
pic_macro_macroexpand(pic_state *pic) pic_macro_macroexpand(pic_state *pic)
{ {
@ -652,6 +662,7 @@ pic_init_macro(pic_state *pic)
{ {
pic_deflibrary ("(picrin macro)") { pic_deflibrary ("(picrin macro)") {
pic_defun(pic, "gensym", pic_macro_gensym); pic_defun(pic, "gensym", pic_macro_gensym);
pic_defun(pic, "ungensym", pic_macro_ungensym);
pic_defun(pic, "macroexpand", pic_macro_macroexpand); pic_defun(pic, "macroexpand", pic_macro_macroexpand);
pic_defun(pic, "macroexpand-1", pic_macro_macroexpand_1); pic_defun(pic, "macroexpand-1", pic_macro_macroexpand_1);
pic_defun(pic, "identifier?", pic_macro_identifier_p); pic_defun(pic, "identifier?", pic_macro_identifier_p);