picrin/contrib/05.r7rs/scheme/eval.scm

18 lines
473 B
Scheme
Raw Normal View History

2014-08-03 01:19:55 -04:00
(define-library (scheme eval)
2014-09-08 07:20:08 -04:00
(import (picrin base))
2014-08-03 01:19:55 -04:00
(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))))
2014-09-08 07:20:08 -04:00
(export environment eval))