Re: Controlling library availability SRFI?
Peter McGoron 28 Sep 2026 14:40 UTC
Personally, I prefer the "wrapping define-library" solution. Reading the
define-library does not seem like it would be that much of a performance
drag, especially if it is deferred until library invocation time.
The library mask file (as far as I can tell reading it) has the drawback
that all information is in a single database, so composing multiple
library paths together would be difficult.
I'm uncertain how many implementations actually allow for something like
(cond-expand
((not full-numeric-tower))
(else
(define-library (my library)
...)))
Adding a new define-library for might be easier and makes it little less
convoluted:
(define-library (my library)
(cond-expand
((and srfi-NNN (not full-numeric-tower)) (hide))
(else))
...)
If the search system for (library ...) encounters a library that is
hidden, it returns #f for that cond-expand feature, and if it tries to
load a hidden library, it signals an error.
Of course, cond-expand into a define-library has the benefit that it
doesn't have to modify the library syntax. (Times like this would make
you wish for a macro system that worked for library definitions...)
-- Peter McGoron