load srfi files at init. close #61

This commit is contained in:
Yuichi Nishiwaki 2014-03-15 20:52:49 +09:00
parent b4609aafb7
commit 0e1b6d93b4
2 changed files with 10 additions and 15 deletions

View File

@ -1,10 +1,7 @@
(define-library (srfi 95)
(import (scheme base)
(scheme load))
;; this hack works only if the current directory is the root of picrin.
(load "piclib/srfi/1.scm")
(import (srfi 1))
(scheme load)
(srfi 1))
(define (list-sorted? ls less?)
(let loop ((cur ls))

View File

@ -32,17 +32,10 @@ void pic_init_write(pic_state *);
void
pic_load_stdlib(pic_state *pic)
{
static const char *filename = "piclib/built-in.scm";
pic_try {
/* load 'built-in.scm' */
pic_load(pic, filename);
#if DEBUG
puts("successfully loaded stdlib");
#endif
pic_load(pic, "piclib/built-in.scm");
pic_load(pic, "piclib/srfi/1.scm");
pic_load(pic, "piclib/srfi/95.scm");
}
pic_catch {
/* error! */
@ -50,6 +43,11 @@ pic_load_stdlib(pic_state *pic)
fputs(pic_errmsg(pic), stderr);
abort();
}
#if DEBUG
puts("successfully loaded stdlib");
#endif
}
#define PUSH_SYM(pic, lst, name) \