From 4684239efa63dc1b2c1cbe37ef7d3062029f5532 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:40 -0800 Subject: Import Upstream version 3b1 --- RScheme.init | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'RScheme.init') diff --git a/RScheme.init b/RScheme.init index 87aacdb..a9607f4 100644 --- a/RScheme.init +++ b/RScheme.init @@ -31,11 +31,15 @@ ;;; the directory where any auxillary files to your Scheme ;;; implementation reside. -(define (implementation-vicinity) - (case (software-type) - ((unix) "/usr/local/lib/rs/0.7.1/") - ((vms) "scheme$src:") - ((ms-dos) "C:\\scheme\\"))) +(define implementation-vicinity + (let ((impl-path + (or (getenv "RSCHEME_IMPLEMENTATION_PATH") + (case (software-type) + ((unix) "/usr/local/lib/rs/0.7.1/") + ((vms) "scheme$src:") + ((ms-dos) "C:\\scheme\\") + (else ""))))) + (lambda () impl-path))) ;;; (library-vicinity) should be defined to be the pathname of the ;;; directory where files of Scheme library functions reside. @@ -103,8 +107,7 @@ ;@ (define sub-vicinity (case (software-type) - ((vms) (lambda - (vic name) + ((vms) (lambda (vic name) (let ((l (string-length vic))) (if (or (zero? (string-length vic)) (not (char=? #\] (string-ref vic (- l 1))))) @@ -144,6 +147,7 @@ ;(SLIB:LOAD-COMPILED "filename") vicinity srfi-59 + srfi-96 ;; Scheme report features ;; R5RS-compliant implementations should provide all 9 features. @@ -187,11 +191,11 @@ ;; Other common features - srfi ;srfi-0, COND-EXPAND finds all srfi-* + srfi-0 ;srfi-0, COND-EXPAND finds all srfi-* ;;; sicp ;runs code from Structure and ;Interpretation of Computer ;Programs by Abelson and Sussman. -;;; defmacro ;has Common Lisp DEFMACRO + defmacro ;has Common Lisp DEFMACRO ;;; record ;has user defined data structures string-port ;has CALL-WITH-INPUT-STRING and ;CALL-WITH-OUTPUT-STRING @@ -283,14 +287,6 @@ ;;; Return argument ;;(define (identity x) x) -;;; If your implementation provides eval SLIB:EVAL is single argument -;;; eval using the top-level (user) environment. -(define slib:eval eval) - -;;; If your implementation provides R4RS macros: -;(define macro:eval slib:eval) -;(define macro:load load) - (define *defmacros* (list (cons 'defmacro (lambda (name parms . body) @@ -320,14 +316,14 @@ (string->symbol (string-append "slib:G" (number->string *gensym-counter*)))))) -(define base:eval slib:eval) -(define (defmacro:eval x) (base:eval (defmacro:expand* x))) +;;; SLIB:EVAL is single argument eval using the top-level (user) +;;; environment. +(define slib:eval eval) +(define (defmacro:eval x) (eval (defmacro:expand* x))) (define (defmacro:expand* x) (require 'defmacroexpand) (apply defmacro:expand* x '())) - (define (defmacro:load ) (slib:eval-load defmacro:eval)) -;; slib:eval-load definition moved to "require.scm" (define slib:warn (lambda args @@ -372,17 +368,22 @@ ;;; (SLIB:LOAD-SOURCE "foo") should load "foo.scm" or with whatever ;;; suffix all the module files in SLIB have. See feature 'SOURCE. - (define (slib:load-source f) (load (string-append f ".scm"))) ;;; (SLIB:LOAD-COMPILED "foo") should load the file that was produced ;;; by compiling "foo.scm" if this implementation can compile files. ;;; See feature 'COMPILED. - (define slib:load-compiled load) ;;; At this point SLIB:LOAD must be able to load SLIB files. - (define slib:load slib:load-source) +;;; If your implementation provides R4RS macros: +;;(define macro:eval slib:eval) +;;(define macro:load load) + +;;; If your implementation provides syntax-case macros: +;;(define syncase:eval slib:eval) +;;(define syncase:load slib:load-source) + (slib:load (in-vicinity (library-vicinity) "require")) -- cgit v1.2.3