From 63d3510de8210643483196ddd5d16adfae5a0ffc Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 17 Jun 2015 00:13:00 +0900 Subject: [PATCH] move features procedure defun to state.c benz --- contrib/05.r7rs/scheme/base.scm | 4 +++- extlib/benz/state.c | 10 ++++++++++ piclib/picrin/base.scm | 4 +++- src/main.c | 12 ------------ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/contrib/05.r7rs/scheme/base.scm b/contrib/05.r7rs/scheme/base.scm index 08d438c0..927643aa 100644 --- a/contrib/05.r7rs/scheme/base.scm +++ b/contrib/05.r7rs/scheme/base.scm @@ -518,4 +518,6 @@ write-string write-u8 write-bytevector - flush-output-port)) + flush-output-port) + + (export features)) diff --git a/extlib/benz/state.c b/extlib/benz/state.c index 65c0bcf5..39b506ce 100644 --- a/extlib/benz/state.c +++ b/extlib/benz/state.c @@ -91,6 +91,14 @@ pic_init_features(pic_state *pic) #endif } +static pic_value +pic_features(pic_state *pic) +{ + pic_get_args(pic, ""); + + return pic->features; +} + #define DONE pic_gc_arena_restore(pic, ai); static void @@ -111,6 +119,8 @@ pic_init_core(pic_state *pic) pic_define_syntactic_keyword(pic, pic->lib->env, pic->sBEGIN, pic->uBEGIN); pic_define_syntactic_keyword(pic, pic->lib->env, pic->sDEFINE_MACRO, pic->uDEFINE_MACRO); + pic_defun(pic, "features", pic_features); + pic_init_undef(pic); DONE; pic_init_bool(pic); DONE; pic_init_pair(pic); DONE; diff --git a/piclib/picrin/base.scm b/piclib/picrin/base.scm index 224043fb..a9d6d7fa 100644 --- a/piclib/picrin/base.scm +++ b/piclib/picrin/base.scm @@ -286,4 +286,6 @@ write-shared display) - (export eval)) + (export eval) + + (export features)) diff --git a/src/main.c b/src/main.c index fbdae10c..a4a330ef 100644 --- a/src/main.c +++ b/src/main.c @@ -7,14 +7,6 @@ void pic_init_contrib(pic_state *); void pic_load_piclib(pic_state *); -static pic_value -pic_features(pic_state *pic) -{ - pic_get_args(pic, ""); - - return pic->features; -} - static pic_value pic_libraries(pic_state *pic) { @@ -38,10 +30,6 @@ pic_init_picrin(pic_state *pic) pic_defun(pic, "libraries", pic_libraries); } - pic_deflibrary (pic, "(scheme base)") { - pic_defun(pic, "features", pic_features); - } - pic_init_contrib(pic); pic_load_piclib(pic); }