261: Portable SRFI Library Reference

by WANG Zheng (ufo5260987423)

Status

This SRFI is currently in draft status. Here is an explanation of each status that a SRFI can hold. To provide input on this SRFI, please send email to srfi-261@nospamsrfi.schemers.org. To subscribe to the list, follow these instructions. You can access previous messages via the mailing list archive.

Abstract

This SRFI proposal addresses systemic compatibility issues exposed by the library reference format defined in SRFI 97 (srfi :<SRFI number> <identifier> ...) and advocates for a modernized, portable alternative: (srfi srfi-<SRFI number> <identifier> ...).

Issues

None at present.

Rationale

SRFI 97 minimized assumptions made about a Scheme system's conformance so that systems may support SRFI Libraries without needing to support all of the R6RS and R7RS library systems. However, its SRFI library reference format (srfi :<SRFI number> <identifiers> ...) introduces portability and toolchain challenges due to the colon : character. This design stems from R6RS's prohibition against unsigned integers as standalone library name components (e.g., (1 lists) being invalid). This proposal advocates replacing it with (srfi srfi-<SRFI number> <identifier>...), resolving three core issues:

  1. Filesystem Incompatibility: Colons are reserved characters in major systems (e.g., Windows drive identifiers C://). Mapping (srfi :1) to paths like srfi/:1/ fails on Windows and requires error-prone workarounds elsewhere. Hyphens - are universally valid, enabling predictable paths like srfi/srfi-1/.
  2. Modern Scheme Unalignment: R7RS's hierarchical define-library syntax favors flat namespaces (e.g., (srfi 1)), while implementations like Larceny already phase out colons for newer SRFIs. The srfi- prefix retains backward compatibility while harmonizing with R7RS trends.
  3. URI Incompatibility: The colon : is a reserved character in URI syntax (RFC 3986), mandating percent-encoding (e.g., srfi%3A1), while the hyphen is an unreserved character that requires no escaping, ensuring cleaner and more human-readable URIs.

Specification

A SRFI library reference should have the form

(srfi srfi-<uinteger 10> <identifier> ...),

where <identifier> is one of the included SRFI library names defined below, and <uinteger 10> is a SRFI number. The non-terminals <uinteger 10> and <identifier> are defined as given in R6RS Chapter 4, Lexical syntax.

Discussion: The srfi- prefix is used in order to make the SRFI number component an identifier, as required by R6RS.

A SRFI Library can be referenced by number, as in

(srfi srfi-1), 

or equivalently using the library's name, as in

(srfi srfi-1 lists). 

Implementation

There is no reference implementation as this SRFI only specifies a portable SRFI library reference.

Acknowledgements

I thank Marc Nieper-Wißkirchen for suggesting that I write this SRFI and providing a fairly complete context. I just wrote down his discussions.

© 2025 WANG Zheng (ufo5260987423).

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Editor: Arthur A. Gleckler