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)
|
2016-02-18 03:39:32 -05:00
|
|
|
(let ((lib (string-append "picrin.@@my-environment." (number->string counter))))
|
2016-02-06 14:23:46 -05:00
|
|
|
(inc! counter)
|
2016-02-18 03:39:32 -05:00
|
|
|
(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))
|