summaryrefslogtreecommitdiffstats
path: root/gambit.init
diff options
context:
space:
mode:
Diffstat (limited to 'gambit.init')
-rw-r--r--gambit.init48
1 files changed, 27 insertions, 21 deletions
diff --git a/gambit.init b/gambit.init
index e431160..dce1a07 100644
--- a/gambit.init
+++ b/gambit.init
@@ -34,19 +34,22 @@
;;; the directory where any auxillary files to your Scheme
;;; implementation reside.
(define implementation-vicinity
- (case (software-type)
- ((unix) (lambda () "/usr/local/share/gambc/"))
- ((vms) (lambda () "scheme$src:"))
- ((ms-dos) (lambda () "C:\\scheme\\"))
- ((windows) (lambda () "c:/scheme/"))
- ((macos)
- (let ((arg0 (list-ref (argv) 0)))
- (let loop ((i (- (string-length arg0) 1)))
- (cond ((negative? i) "")
- ((char=? #\: (string-ref arg0 i))
- (set! arg0 (substring arg0 0 (+ i 1)))
- (lambda () arg0))
- (else (loop (- i 1)))))))))
+ (let ((impl-path
+ (or (getenv "GAMBIT_IMPLEMENTATION_PATH")
+ (case (software-type)
+ ((unix) "/usr/local/share/gambc/")
+ ((vms) "scheme$src:")
+ ((ms-dos) "C:\\scheme\\")
+ ((windows) "c:/scheme/")
+ ((macos)
+ (let ((arg0 (list-ref (argv) 0)))
+ (let loop ((i (- (string-length arg0) 1)))
+ (cond ((negative? i) "")
+ ((char=? #\: (string-ref arg0 i))
+ (substring arg0 0 (+ i 1)))
+ (else (loop (- i 1)))))))
+ (else "")))))
+ (lambda () impl-path)))
;;; (library-vicinity) should be defined to be the pathname of the
;;; directory where files of Scheme library functions reside.
@@ -123,8 +126,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)))))
@@ -165,6 +167,7 @@
;(SLIB:LOAD-COMPILED "filename")
vicinity
srfi-59
+ srfi-96
;; Scheme report features
;; R5RS-compliant implementations should provide all 9 features.
@@ -208,7 +211,7 @@
;; 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.
@@ -347,10 +350,6 @@
;;; 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)
@@ -385,7 +384,6 @@
(define (defmacro:load <pathname>)
(slib:eval-load <pathname> defmacro:eval))
-;; slib:eval-load definition moved to "require.scm"
(define print-call-stack identity) ;noop
@@ -441,6 +439,14 @@
;;; 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 slib:load-source)
+
+;;; If your implementation provides syntax-case macros:
+;;(define syncase:eval slib:eval)
+;;(define syncase:load slib:load-source)
+
(slib:eval '(define-macro (defmacro name parms . body)
(set! *defmacros* (cons `(cons ',name (lambda ,parms ,@body))
*defmacros*))