* boot-9.scm: %load-path is initialized in C code now.
authorJim Blandy <jimb@red-bean.com>
Thu, 5 Sep 1996 16:33:42 +0000 (16:33 +0000)
committerJim Blandy <jimb@red-bean.com>
Thu, 5 Sep 1996 16:33:42 +0000 (16:33 +0000)
(implementation-vicinity, parse-path): Deleted, along with code to
initialize %load-path.

* boot-9.scm (in-vicinity): If the vicinity doesn't end with a
"/", use one to separate it from the file.

ice-9/boot-9.scm

index 330b6a7..50ba8f6 100644 (file)
 ;;; {Load Paths}
 ;;;
 
-(define implementation-vicinity compiled-library-path)
-
 ;;; Here for backward compatability
 ;;
 (define scheme-file-suffix (lambda () ".scm"))
 
-(define in-vicinity string-append)
-
-(define (parse-path env_path)
-  (cond ((string? env_path)
-        (let loop ((curdir "") (env env_path) (path '()))
-          (cond ((= (string-length env) 0) 
-                 (if (> (string-length curdir) 0)
-                     (append path (list curdir))
-                     path))
-                ((char=? (string-ref env 0) #\:)
-                 (loop "" 
-                       (substring env 1 (string-length env))
-                       (append path (list curdir))))
-                (#t
-                 (loop (string-append curdir (substring env 0 1))
-                       (substring env 1 (string-length env))
-                       path)))))
-       (#t '())))
-
-;;; we don't have false-if-exception (or defmacro) yet.
-(define %load-path
-  (let ((lp (catch #t (lambda () (getenv "SCHEME_LOAD_PATH"))
-                  (lambda args #f))))
-    (append
-     (parse-path lp)
-     (cons "./"
-          (map (lambda (dir) (in-vicinity (implementation-vicinity) dir "/"))
-               (cons "site"
-                     (map (lambda (dir) (string-append (version) "/" dir))
-                          '("." "gls/guile" "gls" "slib"))))))))
+(define (in-vicinity vicinity file)
+  (let ((tail (let ((len (string-length vicinity)))
+               (if (zero? len) #f
+                   (string-ref vicinity (- len 1))))))
+    (string-append vicinity
+                  (if (eq? tail #\/) "" "/")
+                  file)))
 
 \f
 ;;; {try-load}