diff --git a/extlib/benz b/extlib/benz index c6b46ae2..e58f216b 160000 --- a/extlib/benz +++ b/extlib/benz @@ -1 +1 @@ -Subproject commit c6b46ae2acba046f2c1c3f26e862134de0df846a +Subproject commit e58f216b2da6f4a14a35825f2878728872484e30 diff --git a/piclib/picrin/base.scm b/piclib/picrin/base.scm index f1ac5082..05c2f37b 100644 --- a/piclib/picrin/base.scm +++ b/piclib/picrin/base.scm @@ -27,8 +27,7 @@ else do when - unless - include) + unless) (export let-values let*-values diff --git a/piclib/scheme/base.scm b/piclib/scheme/base.scm index 4fdcf2bc..448f80e6 100644 --- a/piclib/scheme/base.scm +++ b/piclib/scheme/base.scm @@ -22,6 +22,21 @@ ;; 4.1.7. Inclusion + (define-syntax include + (letrec ((read-file + (lambda (filename) + (call-with-port (open-input-file filename) + (lambda (port) + (let loop ((expr (read port)) (exprs '())) + (if (eof-object? expr) + (reverse exprs) + (loop (read port) (cons expr exprs))))))))) + (er-macro-transformer + (lambda (form rename compare) + (let ((filenames (cdr form))) + (let ((exprs (apply append (map read-file filenames)))) + `(,(rename 'begin) ,@exprs))))))) + (export include) ;; 4.2.1. Conditionals