From fbffa4697abfa93542216383427c5355524c370d Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 8 Jan 2014 15:38:47 +0900 Subject: [PATCH] import repl libraries by default --- tools/main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/main.c b/tools/main.c index e85ce926..b9e2ae1b 100644 --- a/tools/main.c +++ b/tools/main.c @@ -29,6 +29,20 @@ print_help(void) puts(help); } +void +import_repllib(pic_state *pic) +{ + int ai = pic_gc_arena_preserve(pic); + + pic_import(pic, pic_parse(pic, "(scheme base)")); + +#if DEBUG + puts("* imported repl libraries"); +#endif + + pic_gc_arena_restore(pic, ai); +} + int exit_status; void @@ -273,6 +287,10 @@ main(int argc, char *argv[], char **envp) parse_opt(argc, argv); + if (mode == INTERACTIVE_MODE || mode == ONE_LINER_MODE) { + import_repllib(pic); + } + switch (mode) { case NO_MODE: puts("logic flaw");