From bbac314465586dada1c97817ef0130aaa123cc9d Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 24 Mar 2017 11:26:32 -0700 Subject: [PATCH] Add option-loaded?. --- src/runtime/ffi.scm | 2 +- src/runtime/option.scm | 3 +++ src/runtime/runtime.pkg | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/runtime/ffi.scm b/src/runtime/ffi.scm index 35d70416b..1c1a67d60 100644 --- a/src/runtime/ffi.scm +++ b/src/runtime/ffi.scm @@ -602,7 +602,7 @@ USA. ((environment-lookup (->environment '(ffi)) 'update-html-index) directory)) (define (load-option-quietly name) - (if (not (name->package (list name))) + (if (not (option-loaded? name)) (let ((kernel (lambda () (parameterize* (list (cons param:suppress-loading-message? #t)) diff --git a/src/runtime/option.scm b/src/runtime/option.scm index c19850735..18ae8f767 100644 --- a/src/runtime/option.scm +++ b/src/runtime/option.scm @@ -58,6 +58,9 @@ USA. name (find-option (*options*) (*parent*))))) +(define (option-loaded? name) + (not (eq? #f (memq name loaded-options)))) + (define (define-load-option name . loaders) (*options* (cons (cons name loaders) (*options*))) unspecific) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index fa194bab4..886377c61 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -3296,6 +3296,7 @@ USA. further-load-options load-option local-load-options + option-loaded? standard-load-options standard-option-loader standard-system-loader) -- 2.25.1