add null-environment and scheme-report-environment
This commit is contained in:
parent
fd8330cca3
commit
076698c84a
|
@ -8,6 +8,8 @@ list(APPEND PICLIB_SCHEME_LIBS
|
||||||
${PROJECT_SOURCE_DIR}/piclib/scheme/file.scm
|
${PROJECT_SOURCE_DIR}/piclib/scheme/file.scm
|
||||||
${PROJECT_SOURCE_DIR}/piclib/scheme/case-lambda.scm
|
${PROJECT_SOURCE_DIR}/piclib/scheme/case-lambda.scm
|
||||||
${PROJECT_SOURCE_DIR}/piclib/scheme/lazy.scm
|
${PROJECT_SOURCE_DIR}/piclib/scheme/lazy.scm
|
||||||
|
${PROJECT_SOURCE_DIR}/piclib/scheme/r5rs.scm
|
||||||
|
${PROJECT_SOURCE_DIR}/piclib/scheme/null.scm
|
||||||
${PROJECT_SOURCE_DIR}/piclib/srfi/1.scm
|
${PROJECT_SOURCE_DIR}/piclib/srfi/1.scm
|
||||||
${PROJECT_SOURCE_DIR}/piclib/srfi/8.scm
|
${PROJECT_SOURCE_DIR}/piclib/srfi/8.scm
|
||||||
${PROJECT_SOURCE_DIR}/piclib/srfi/26.scm
|
${PROJECT_SOURCE_DIR}/piclib/srfi/26.scm
|
||||||
|
|
|
@ -1073,3 +1073,20 @@
|
||||||
(apply values args)))))))))))))
|
(apply values args)))))))))))))
|
||||||
|
|
||||||
(export guard)
|
(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)))
|
||||||
|
|
||||||
|
(export null-environment
|
||||||
|
scheme-report-environment
|
||||||
|
))
|
||||||
|
|
|
@ -7,5 +7,19 @@
|
||||||
(define (call-with-output-file filename callback)
|
(define (call-with-output-file filename callback)
|
||||||
(call-with-port (open-output-file filename) callback))
|
(call-with-port (open-output-file filename) callback))
|
||||||
|
|
||||||
|
(define (with-input-from-file filename thunk)
|
||||||
|
(call-with-input-file filename
|
||||||
|
(lambda (port)
|
||||||
|
(parameterize ((current-input-port port))
|
||||||
|
(thunk)))))
|
||||||
|
|
||||||
|
(define (with-output-to-file filename thunk)
|
||||||
|
(call-with-output-file filename
|
||||||
|
(lambda (port)
|
||||||
|
(parameterize ((current-output-port port))
|
||||||
|
(thunk)))))
|
||||||
|
|
||||||
(export call-with-input-file
|
(export call-with-input-file
|
||||||
call-with-output-file))
|
call-with-output-file
|
||||||
|
with-input-from-file
|
||||||
|
with-output-to-file))
|
||||||
|
|
Loading…
Reference in New Issue