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

17 lines
373 B
Scheme

(define-library (scheme eval)
(import (picrin base))
(define counter 0)
(define-syntax (inc! n)
#`(set! #,n (+ #,n 1)))
(define (environment . specs)
(let ((lib (string-append "picrin.@@my-environment." (number->string counter))))
(inc! counter)
(make-library lib)
(eval `(import ,@specs) lib)
lib))
(export environment eval))