diff --git a/piclib/picrin/macro.scm b/piclib/picrin/macro.scm index d798df0f..7f9ab9e4 100644 --- a/piclib/picrin/macro.scm +++ b/piclib/picrin/macro.scm @@ -1,7 +1,8 @@ ;;; Hygienic Macros (define-library (picrin macro) - (import (scheme base) + (import (picrin base core) + (scheme base) (picrin dictionary)) ;; assumes no derived expressions are provided yet diff --git a/piclib/scheme/base.scm b/piclib/scheme/base.scm index 66fbe867..86d7a92e 100644 --- a/piclib/scheme/base.scm +++ b/piclib/scheme/base.scm @@ -1,5 +1,9 @@ (define-library (scheme base) - (import (picrin macro)) + (import (picrin base core) + (picrin macro)) + + (export define set! lambda quote + if begin define-syntax) ;; core syntax diff --git a/src/init.c b/src/init.c index f9c8dba8..c1b573db 100644 --- a/src/init.c +++ b/src/init.c @@ -62,10 +62,7 @@ pic_init_core(pic_state *pic) { size_t ai = pic_gc_arena_preserve(pic); - pic_deflibrary (pic, "(scheme base)") { - - /* load core syntaces */ - pic->lib->env = pic_null_syntactic_environment(pic); + pic_deflibrary (pic, "(picrin base core)") { pic_define_syntactic_keyword(pic, pic->lib->env, pic->sDEFINE, pic->rDEFINE); pic_define_syntactic_keyword(pic, pic->lib->env, pic->sSETBANG, pic->rSETBANG); pic_define_syntactic_keyword(pic, pic->lib->env, pic->sQUOTE, pic->rQUOTE); @@ -73,7 +70,9 @@ pic_init_core(pic_state *pic) pic_define_syntactic_keyword(pic, pic->lib->env, pic->sIF, pic->rIF); pic_define_syntactic_keyword(pic, pic->lib->env, pic->sBEGIN, pic->rBEGIN); pic_define_syntactic_keyword(pic, pic->lib->env, pic->sDEFINE_SYNTAX, pic->rDEFINE_SYNTAX); + } + pic_deflibrary (pic, "(scheme base)") { pic_init_bool(pic); DONE; pic_init_pair(pic); DONE; pic_init_port(pic); DONE;