From f32754c0f906c1ff876f622c49745c9d32205d00 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 13 Feb 2014 14:59:17 +0900 Subject: [PATCH] place define-macro syntax in (picrin macro) library --- src/init.c | 1 - src/macro.c | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/init.c b/src/init.c index be998436..36c4e290 100644 --- a/src/init.c +++ b/src/init.c @@ -90,7 +90,6 @@ pic_init_core(pic_state *pic) pic_export(pic, pic_intern_cstr(pic, "lambda")); pic_export(pic, pic_intern_cstr(pic, "if")); pic_export(pic, pic_intern_cstr(pic, "begin")); - pic_export(pic, pic_intern_cstr(pic, "define-macro")); pic_export(pic, pic_intern_cstr(pic, "define-syntax")); pic_init_bool(pic); DONE; diff --git a/src/macro.c b/src/macro.c index adc19925..f44f5812 100644 --- a/src/macro.c +++ b/src/macro.c @@ -598,7 +598,6 @@ pic_core_syntactic_env(pic_state *pic) register_core_syntax(pic, senv, "lambda"); register_core_syntax(pic, senv, "if"); register_core_syntax(pic, senv, "begin"); - register_core_syntax(pic, senv, "define-macro"); register_core_syntax(pic, senv, "define-syntax"); return senv; @@ -894,6 +893,11 @@ pic_init_macro(pic_state *pic) pic_defmacro(pic, "include", pic_proc_new(pic, pic_macro_include)); pic_deflibrary ("(picrin macro)") { + + /* export define-macro syntax */ + xh_put_int(pic->lib->senv->name, pic->sDEFINE_MACRO, pic->sDEFINE_MACRO); + pic_export(pic, pic->sDEFINE_MACRO); + 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);