managed to make it work
This commit is contained in:
parent
8764bec50b
commit
7f092cb9ab
|
@ -7,6 +7,20 @@
|
|||
(export define set! lambda quote
|
||||
if begin define-syntax)
|
||||
|
||||
;; call/cc
|
||||
|
||||
(define real-callcc call-with-current-continuation)
|
||||
|
||||
(set! call-with-current-continuation
|
||||
(lambda (f)
|
||||
(real-callcc
|
||||
(lambda (c)
|
||||
(f (lambda args (apply continue c args)))))))
|
||||
|
||||
(define call/cc call-with-current-continuation)
|
||||
|
||||
(export call/cc)
|
||||
|
||||
;; core syntax
|
||||
|
||||
(define-syntax syntax-error
|
||||
|
@ -840,6 +854,10 @@
|
|||
|
||||
(export define-record-type)
|
||||
|
||||
(export (rename floor-remainder modulo)
|
||||
(rename truncate-quotient quotient)
|
||||
(rename truncate-remainder remainder))
|
||||
|
||||
;; 6.4 Pairs and lists
|
||||
|
||||
(export pair?
|
||||
|
@ -920,7 +938,10 @@
|
|||
(define (string . objs)
|
||||
(list->string objs))
|
||||
|
||||
(export string string->list list->string)
|
||||
(export string
|
||||
string->list
|
||||
list->string
|
||||
(rename string-copy substring))
|
||||
|
||||
;; 6.8. Vector
|
||||
|
||||
|
|
19
src/init.c
19
src/init.c
|
@ -35,11 +35,19 @@ pic_libraries(pic_state *pic)
|
|||
return libs;
|
||||
}
|
||||
|
||||
void pic_init_eval(pic_state *);
|
||||
void pic_init_file(pic_state *);
|
||||
void pic_init_load(pic_state *);
|
||||
void pic_init_macro2(pic_state *);
|
||||
void pic_init_system(pic_state *);
|
||||
void pic_init_time(pic_state *);
|
||||
|
||||
void pic_init_contrib(pic_state *);
|
||||
|
||||
void pic_load_piclib(pic_state *);
|
||||
|
||||
void
|
||||
pic_init_misc(pic_state *pic)
|
||||
pic_init_picrin(pic_state *pic)
|
||||
{
|
||||
pic_deflibrary (pic, "(picrin library)") {
|
||||
pic_defun(pic, "libraries", pic_libraries);
|
||||
|
@ -47,7 +55,16 @@ pic_init_misc(pic_state *pic)
|
|||
|
||||
pic_deflibrary (pic, "(scheme base)") {
|
||||
pic_defun(pic, "features", pic_features);
|
||||
|
||||
pic_init_eval(pic);
|
||||
pic_init_file(pic);
|
||||
pic_init_load(pic);
|
||||
pic_init_macro2(pic);
|
||||
pic_init_system(pic);
|
||||
pic_init_time(pic);
|
||||
|
||||
pic_init_contrib(pic);
|
||||
|
||||
pic_load_piclib(pic);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ main(int argc, char *argv[], char **envp)
|
|||
|
||||
pic = pic_open(argc, argv, envp);
|
||||
|
||||
pic_init_picrin(pic);
|
||||
|
||||
pic_try {
|
||||
pic_import(pic, pic_read_cstr(pic, "(picrin main)"));
|
||||
pic_funcall(pic, "main", pic_nil_value());
|
||||
|
|
Loading…
Reference in New Issue