From 9e7b4da56c207dbbf2f6df1c385c68edb80b6f32 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 17 Jul 2014 10:21:00 +0900 Subject: [PATCH] add make-identifier function --- src/macro.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/macro.c b/src/macro.c index 4624cccc..16c7816c 100644 --- a/src/macro.c +++ b/src/macro.c @@ -940,6 +940,19 @@ pic_macro_ir_macro_transformer(pic_state *pic) return pic_obj_value(proc); } +static pic_value +pic_macro_make_identifier(pic_state *pic) +{ + pic_value obj; + pic_sym sym; + + pic_get_args(pic, "mo", &sym, &obj); + + pic_assert_type(pic, obj, senv); + + return pic_sym_value(make_identifier(pic, sym, pic_senv_ptr(obj), pic_dict_new(pic))); +} + void pic_init_macro(pic_state *pic) { @@ -955,5 +968,6 @@ pic_init_macro(pic_state *pic) pic_defun(pic, "identifier=?", pic_macro_identifier_eq_p); pic_defun(pic, "er-macro-transformer", pic_macro_er_macro_transformer); pic_defun(pic, "ir-macro-transformer", pic_macro_ir_macro_transformer); + pic_defun(pic, "make-identifier", pic_macro_make_identifier); } }