From 5601f2d9aaeec3e608521113e5ec6d74b20e63c3 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 25 Apr 2017 16:55:13 -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 ca6ba622c..260614c91 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 95bc23913..fd500ba44 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -3323,6 +3323,7 @@ USA. further-load-options load-option local-load-options + option-loaded? standard-load-options standard-option-loader standard-system-loader) -- 2.25.1