From 1451bf7f8e32163ae4f7c05604317a747f65825b Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 24 Oct 2016 03:09:59 +0000 Subject: [PATCH] Added (library-exists?) --- scheme/cyclone/libraries.sld | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scheme/cyclone/libraries.sld b/scheme/cyclone/libraries.sld index 6b1efa3a..0c67fb1e 100644 --- a/scheme/cyclone/libraries.sld +++ b/scheme/cyclone/libraries.sld @@ -20,6 +20,7 @@ ) (export library? + library-exists? lib:list->import-set lib:name lib:name->string @@ -60,6 +61,13 @@ (define (library? ast) (tagged-list? 'define-library ast)) + +;; Determine if a library exists for the given import set +(define (library-exists? import . ext) + (file-exists? + (lib:import->filename + (lib:import->library-name import) + (if (null? ext) ".sld" (car ext))))) ;; Convert a raw list to an import set. For example, a list might be ;; (srfi 18) containing the number 18. An import set contains only symbols