add environment procedure

This commit is contained in:
Yuichi Nishiwaki 2014-07-27 14:29:29 +09:00
parent 076698c84a
commit 137a01e74e
1 changed files with 14 additions and 1 deletions

View File

@ -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))