The R7RS reference version and define-optionals Shawn Wagner (20 Apr 2023 11:45 UTC)
Library names and sublibrary names Lassi Kortela (20 Apr 2023 12:01 UTC)
Re: Library names and sublibrary names Shawn Wagner (20 Apr 2023 12:06 UTC)
Re: Library names and sublibrary names Marc Nieper-Wißkirchen (21 Apr 2023 07:45 UTC)
Re: Library names and sublibrary names John Cowan (22 Apr 2023 03:00 UTC)
Re: Library names and sublibrary names Marc Nieper-Wißkirchen (22 Apr 2023 05:37 UTC)
Re: The R7RS reference version and define-optionals Arthur A. Gleckler (22 Apr 2023 23:02 UTC)

Library names and sublibrary names Lassi Kortela 20 Apr 2023 12:01 UTC

> The specification says that define-optionals and define-optionals* are
> supposed to be provided in the (srfi 227 definition) library, which is
> missing. The forms are defined in the source, but not used. There's an
> old open pull request that adds exports for them from (srfi 227)
> instead of adding the sublibrary.
>
> The R6RS version does provide them in its equivalent library.

Sublibraries for SRFIs are problematic in that they share the same
namespace as the "library names" we have been accumulating ever since
SRFI 97 (SRFI Libraries).

A recent listing of the library names can currently be found here:
https://docs.scheme.org/srfi/library-names/ (We haven't found a good URL
for this listing yet.) Or use the `srfi library-names` command from
srfi-tools.

So far SRFI library names are only used with R6RS but this is a
historical accident. There's no reason they couldn't be used identically
with R7RS.

SRFI 227 doesn't yet have a library name listed, but a decent one would
be "optional" or "optionals", as in:

(import (srfi :227 optional))  ; R6RS syntax
(import (srfi 227 optional))   ; R7RS syntax

If there is a "definition" sublibrary, the list of conceivable imports
is extended thus:

(import (srfi :227 optional))  ; R6RS syntax
(import (srfi :227 definition))  ; style 1
(import (srfi :227 optional definition))  ; style 2

(import (srfi 227 optional))   ; R7RS syntax
(import (srfi 227 definition))  ; style 1
(import (srfi 227 optional definition))  ; style 2

So far, the SRFI process hasn't made a choice between style 1 and style
2. Style 1 is shorter but it confusingly puts both library names and
sublibrary names at the same position in the list. Style 2 is more
consistent but also more verbose.