]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
Compute library-directory-path on-demand.
authorTaylor R Campbell <campbell+mit-scheme@mumble.net>
Tue, 7 Jul 2020 17:08:40 +0000 (17:08 +0000)
committerTaylor R Campbell <campbell+mit-scheme@mumble.net>
Tue, 7 Jul 2020 18:41:33 +0000 (18:41 +0000)
Avoid saving it in bands.

(cherry picked from commit 18433bcdc1d385df320f0bdfe591abdb38b4abb0)

src/runtime/load.scm
src/runtime/option.scm
src/runtime/pathname.scm

index f9b0fdb5d392e1510e7eb50048b6d440f6565267..c30213af23f2dce08f5b6f15905da477a6feb348 100644 (file)
@@ -513,7 +513,7 @@ USA.
              (thunk)))))))
 
 (define (standard-library-directory-pathname)
-  (last library-directory-path))
+  (last (library-directory-path)))
 
 (define (pathname->standard-uri pathname)
   (let ((uri
index d483d4b22bc0c29657b657ef3a7cecd2e24f7f36..b975910d449f20f83e698d4e9a8fc20e4e9bed45 100644 (file)
@@ -33,7 +33,7 @@ USA.
 \f
 (define (load-option name #!optional no-error?)
   (let ((no-error? (and (not (default-object? no-error?)) no-error?))
-       (path library-directory-path))
+       (path (library-directory-path)))
 
     (define (find-option options parent)
       (cond ((assq name options) => load-entry)
index 1f224bea16d0ffc40ca9caf6003eb8c85a770c68..505d29f6aebd8466132a1979755947eb4ee95cee 100644 (file)
@@ -651,18 +651,20 @@ these rules:
 
 (define (%find-library-directory)
   (pathname-simplify
-   (or (find file-directory? library-directory-path)
+   (or (find file-directory? (library-directory-path))
        (error "Can't find library directory."))))
 
 (define (%find-library-file pathname)
-  (let loop ((path library-directory-path))
+  (let loop ((path (library-directory-path)))
     (and (pair? path)
         (let ((p (merge-pathnames pathname (car path))))
           (if (file-exists? p)
               p
               (loop (cdr path)))))))
 
-(define library-directory-path)
+(define (library-directory-path)
+  (map pathname-as-directory
+       (vector->list ((ucode-primitive microcode-library-path 0)))))
 \f
 (define known-host-types
   '((0 unix)
@@ -727,9 +729,6 @@ these rules:
       (set! local-host (make-host host-type #f))))
   (set! param:default-pathname-defaults (make-param:default-pathname-defaults))
   (set! *default-pathname-defaults* (param:default-pathname-defaults))
-  (set! library-directory-path
-       (map pathname-as-directory
-            (vector->list ((ucode-primitive microcode-library-path 0)))))
   unspecific)
 
 (add-boot-init!