diff --git a/README.md b/README.md index ca361f1b..46e9e19a 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,20 @@ Picrin is a lightweight scheme implementation intended to comply with full R7RS Sorting and Marging. +## The REPL + +At the REPL start-up time, some usuful built-in libraries listed below will be automatically imported. + +- `(scheme base)` +- `(scheme load)` +- `(scheme process-context)` +- `(scheme write)` +- `(scheme file)` +- `(scheme inexact)` +- `(scheme cxr)` +- `(scheme lazy)` +- `(scheme time)` + ## Compliance with R7RS | section | status | comments | diff --git a/src/read.c b/src/read.c index 4b0736b6..e768c10e 100644 --- a/src/read.c +++ b/src/read.c @@ -211,8 +211,7 @@ read_datum(int tok, yyscan_t scanner) error(NULL, scanner); } - /* unreachable */ - return pic_undef_value(); + UNREACHABLE(); } static pic_value diff --git a/tools/main.c b/tools/main.c index ec44ec1f..2ef1a954 100644 --- a/tools/main.c +++ b/tools/main.c @@ -41,6 +41,15 @@ import_repllib(pic_state *pic) int ai = pic_gc_arena_preserve(pic); pic_import(pic, pic_read(pic, "(scheme base)")); + pic_import(pic, pic_read(pic, "(scheme load)")); + pic_import(pic, pic_read(pic, "(scheme process-context)")); + pic_import(pic, pic_read(pic, "(scheme write)")); + pic_import(pic, pic_read(pic, "(scheme file)")); + pic_import(pic, pic_read(pic, "(scheme inexact)")); + pic_import(pic, pic_read(pic, "(scheme cxr)")); + pic_import(pic, pic_read(pic, "(scheme lazy)")); + pic_import(pic, pic_read(pic, "(scheme time)")); + pic_import(pic, pic_read(pic, "(picrin macro)")); #if DEBUG puts("* imported repl libraries");