From fa3f23105ddcf07c5900de47f19af43d1db1b597 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:27 -0800 Subject: Import Upstream version 2c3 --- mitscheme.init | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'mitscheme.init') diff --git a/mitscheme.init b/mitscheme.init index 9486c18..bd612b0 100644 --- a/mitscheme.init +++ b/mitscheme.init @@ -19,8 +19,10 @@ ;;; Make this part of your ~/.scheme.init file. +(define getenv get-environment-variable) + ;;; (software-type) should be set to the generic operating system type. -(define (software-type) 'UNIX) +(define (software-type) (if (getenv "HOMEDRIVE") 'MS-DOS 'UNIX)) ;;; (scheme-implementation-type) should return the name of the scheme ;;; implementation loading this file. @@ -30,16 +32,14 @@ ;;; (scheme-implementation-version) should return a string describing ;;; the version the scheme implementation loading this file. -(define (scheme-implementation-version) "7.3.0") - -;;; *features* should be set to a list of symbols describing features -;;; of this implementation. See Template.scm for the list of feature -;;; names. - -;the following may not be the Right Thing for this application, since -;it causes an error (rather than just returning nil) when the environment -;variable is not defined. -(define getenv get-environment-variable) +(define (scheme-implementation-version) + (let* ((str (with-output-to-string identify-world)) + (beg (+ (substring? "Release " str) 8)) + (rst (substring str beg (string-length str))) + (end (string-find-next-char-in-set + rst + (predicate->char-set char-whitespace?)))) + (substring rst 0 end))) ;;; (implementation-vicinity) should be defined to be the pathname of ;;; the directory where any auxillary files to your Scheme @@ -47,7 +47,8 @@ (define (implementation-vicinity) (case (software-type) - ((UNIX) "/usr/local/src/scheme/") + ((MS-DOS) "c:\\scheme\\") + ((UNIX) "/usr/local/lib/mit-scheme/") ((VMS) "scheme$src:"))) ;;; (library-vicinity) should be defined to be the pathname of the @@ -58,9 +59,9 @@ (or (getenv "SCHEME_LIBRARY_PATH") ;; Use this path if your scheme does not support GETENV. (case (software-type) + ((MS-DOS) "c:\\slib\\") ((UNIX) "/usr/local/lib/slib/") ((VMS) "lib$scheme:") - ((MS-DOS) "C:\\SLIB\\") (else ""))))) (lambda () library-path))) @@ -72,6 +73,10 @@ (let ((home-path (getenv "HOME"))) (lambda () home-path))) +;;; *features* should be set to a list of symbols describing features +;;; of this implementation. See Template.scm for the list of feature +;;; names. + (define *features* '( source ;can load scheme source files @@ -103,6 +108,7 @@ pretty-print object->string trace ;has macros: TRACE and UNTRACE + defmacro compiler getenv Xwindows @@ -165,8 +171,7 @@ ;;; Return argument (define (identity x) x) -;;; If your implementation provides eval, SLIB:EVAL is single argument -;;; eval using the top-level (user) environment. +;;; SLIB:EVAL is single argument eval using the top-level (user) environment. ;(define (slib:eval form) (eval form (repl/environment (nearest-repl)))) (define (slib:eval form) (eval form user-initial-environment)) @@ -253,7 +258,7 @@ ;;; Here for backward compatability -(define (scheme-file-suffix) "") +(define (scheme-file-suffix) ".scm") ;;; (SLIB:LOAD-SOURCE "foo") should load "foo.scm" or with whatever ;;; suffix all the module files in SLIB have. See feature 'SOURCE. @@ -270,4 +275,4 @@ (define slib:load slib:load-source) -(slib:load (in-vicinity (library-vicinity) "require")) +(slib:load (in-vicinity (library-vicinity) "require.scm")) -- cgit v1.2.3