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");