From 9375aadf4bd48865e968582bfa57763c484dae1b Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 3 Aug 2014 14:19:55 +0900 Subject: [PATCH] split files --- piclib/CMakeLists.txt | 1 + piclib/prelude.scm | 29 ----------------------------- piclib/scheme/eval.scm | 29 +++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 piclib/scheme/eval.scm diff --git a/piclib/CMakeLists.txt b/piclib/CMakeLists.txt index 9157fda4..d7f3ab7c 100644 --- a/piclib/CMakeLists.txt +++ b/piclib/CMakeLists.txt @@ -8,6 +8,7 @@ list(APPEND PICLIB_SCHEME_LIBS ${PROJECT_SOURCE_DIR}/piclib/scheme/file.scm ${PROJECT_SOURCE_DIR}/piclib/scheme/case-lambda.scm ${PROJECT_SOURCE_DIR}/piclib/scheme/lazy.scm + ${PROJECT_SOURCE_DIR}/piclib/scheme/eval.scm ${PROJECT_SOURCE_DIR}/piclib/scheme/r5rs.scm ${PROJECT_SOURCE_DIR}/piclib/scheme/null.scm ${PROJECT_SOURCE_DIR}/piclib/srfi/1.scm diff --git a/piclib/prelude.scm b/piclib/prelude.scm index 9429c163..fd783a07 100644 --- a/piclib/prelude.scm +++ b/piclib/prelude.scm @@ -1043,32 +1043,3 @@ (export guard) -(define-library (scheme eval) - (import (scheme base)) - - (define (null-environment n) - (if (not (= n 5)) - (error "unsupported environment version" n) - '(scheme null))) - - (define (scheme-report-environment n) - (if (not (= n 5)) - (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)) diff --git a/piclib/scheme/eval.scm b/piclib/scheme/eval.scm new file mode 100644 index 00000000..2a4f3b0f --- /dev/null +++ b/piclib/scheme/eval.scm @@ -0,0 +1,29 @@ +(define-library (scheme eval) + (import (scheme base)) + + (define (null-environment n) + (if (not (= n 5)) + (error "unsupported environment version" n) + '(scheme null))) + + (define (scheme-report-environment n) + (if (not (= n 5)) + (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))