diff --git a/piclib/prelude.scm b/piclib/prelude.scm index b393ead7..e42b5ca3 100644 --- a/piclib/prelude.scm +++ b/piclib/prelude.scm @@ -1087,6 +1087,19 @@ (error "unsupported environment version" n) '(scheme r5rs))) + (define environment + (let ((counter 0)) + (lambda specs + (let ((library-name `(picrin @@my-environment ,counter))) + (set! counter (+ counter 1)) + (eval + `(define-library ,library-name + ,@(map (lambda (spec) + `(import ,spec)) + specs)) + '(scheme base)) + library-name)))) + (export null-environment scheme-report-environment - )) + environment))