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

17 lines
373 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
2016-02-06 14:23:46 -05:00
(define counter 0)
(define-syntax (inc! n)
#`(set! #,n (+ #,n 1)))
2016-02-06 14:54:55 -05:00
(define (environment . specs)
(let ((lib (string-append "picrin.@@my-environment." (number->string counter))))
2016-02-06 14:23:46 -05:00
(inc! counter)
(make-library lib)
(eval `(import ,@specs) lib)
lib))
2014-08-03 01:19:55 -04:00
2014-09-08 07:20:08 -04:00
(export environment eval))