From: Chris Hanson Date: Sun, 27 Oct 2019 05:50:52 +0000 (-0700) Subject: Automatically pre-register libraries in standard places. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~21 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=f06b64690bc8c823065808a08d66ed8d59304f9d;p=mit-scheme.git Automatically pre-register libraries in standard places. --- diff --git a/src/runtime/library-loader.scm b/src/runtime/library-loader.scm index 7dd55fbef..7f284a4e1 100644 --- a/src/runtime/library-loader.scm +++ b/src/runtime/library-loader.scm @@ -196,6 +196,19 @@ USA. (error "Not an exported name:" name)) (cdr p)))))) +(define (preregister-standard-libraries!) + (parameterize ((param:hide-notifications? #t)) + (let ((pn (system-library-directory-pathname "libraries"))) + (if pn + (find-scheme-libraries! pn))) + (let ((pn (init-file-specifier->pathname '("libraries")))) + (if (file-directory? pn) + (find-scheme-libraries! (pathname-as-directory pn)))))) + +(add-boot-init! + (lambda () + (add-event-receiver! event:after-restart preregister-standard-libraries!))) + (define (find-scheme-libraries! pathname) (preregister-libraries! pathname (current-library-db))) diff --git a/src/runtime/make.scm b/src/runtime/make.scm index 1dd45290b..66043d718 100644 --- a/src/runtime/make.scm +++ b/src/runtime/make.scm @@ -478,6 +478,7 @@ USA. (runtime hash) (runtime dynamic) (runtime regular-sexpression) + (runtime library loader) (runtime library standard) ;; Microcode data structures (runtime history)