load srfi files at init. close #61
This commit is contained in:
parent
b4609aafb7
commit
0e1b6d93b4
|
@ -1,10 +1,7 @@
|
||||||
(define-library (srfi 95)
|
(define-library (srfi 95)
|
||||||
(import (scheme base)
|
(import (scheme base)
|
||||||
(scheme load))
|
(scheme load)
|
||||||
|
(srfi 1))
|
||||||
;; this hack works only if the current directory is the root of picrin.
|
|
||||||
(load "piclib/srfi/1.scm")
|
|
||||||
(import (srfi 1))
|
|
||||||
|
|
||||||
(define (list-sorted? ls less?)
|
(define (list-sorted? ls less?)
|
||||||
(let loop ((cur ls))
|
(let loop ((cur ls))
|
||||||
|
|
18
src/init.c
18
src/init.c
|
@ -32,17 +32,10 @@ void pic_init_write(pic_state *);
|
||||||
void
|
void
|
||||||
pic_load_stdlib(pic_state *pic)
|
pic_load_stdlib(pic_state *pic)
|
||||||
{
|
{
|
||||||
static const char *filename = "piclib/built-in.scm";
|
|
||||||
|
|
||||||
pic_try {
|
pic_try {
|
||||||
|
pic_load(pic, "piclib/built-in.scm");
|
||||||
/* load 'built-in.scm' */
|
pic_load(pic, "piclib/srfi/1.scm");
|
||||||
pic_load(pic, filename);
|
pic_load(pic, "piclib/srfi/95.scm");
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
puts("successfully loaded stdlib");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
pic_catch {
|
pic_catch {
|
||||||
/* error! */
|
/* error! */
|
||||||
|
@ -50,6 +43,11 @@ pic_load_stdlib(pic_state *pic)
|
||||||
fputs(pic_errmsg(pic), stderr);
|
fputs(pic_errmsg(pic), stderr);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
puts("successfully loaded stdlib");
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PUSH_SYM(pic, lst, name) \
|
#define PUSH_SYM(pic, lst, name) \
|
||||||
|
|
Loading…
Reference in New Issue