Ergebnis für URL: http://srfi.schemers.org/ #[1]alternate
SRFI surfboard logo Scheme Requests for Implementation[2] RSS
SRFIs extend the Scheme programming language. You can help. Start by [3]joining
the discussion on one of our mailing lists. [4]Learn more.
Thanks to Lassi Kortela for his srfi command, which currently has eighty
subcommands for carrying out various SRFI operations, e.g. show the abstract of a
SRFI, search for a SRFI, open a SRFI in a browser, or clone the Git repo for a
SRFI. It can be found in the [5]SRFI tools directory of the [6]srfi-common repo.
Thanks to Arvydas Silanskas for his [7]index.scheme.org, which is an increasingly
comprehensive index of Scheme implementations and standards.
Thanks to Shiro Kawai for his [8]Practical Scheme, which includes a
[9]cross-reference showing which Scheme implementations support which SRFIs. It's
a wiki page, so please help keep it up to date.
The SRFIs
Javascript is not enabled in your browser, so filtering, searching, and sorting
the list of SRFIs is turned off.
Search for ____________________
Filter by
(BUTTON) keywords ×
[X] any
[ ] Algorithm
[ ] Assignment
[ ] Binding
[ ] Comparison
[ ] Concurrency
[ ] Continuations
[ ] Control Flow
[ ] Data Structure
[ ] Error Handling
[ ] Exceptions
[ ] Features
[ ] Garbage Collection
[ ] I/O
[ ] Internationalization
[ ] Introspection
[ ] Lazy Evaluation
[ ] Miscellaneous
[ ] Modules
[ ] Multiple-Value Returns
[ ] Numbers
[ ] Operating System
[ ] Optimization
[ ] Parameters
[ ] Pattern Matching
[ ] R6RS process
[ ] R7RS Large
[ ] R7RS Large: Red Edition
[ ] R7RS Large: Tangerine Edition
[ ] Randomness
[ ] Reader Syntax
[ ] SICP
[ ] Superseded
[ ] Syntax
[ ] Testing
[ ] Type Checking
(BUTTON) status ×
[X] any
[ ] Draft
[ ] Final
[ ] Withdrawn
Show [ ] abstracts
Sort by (BUTTON) authors (BUTTON) date (BUTTON) name (BUTTON) number (BUTTON)
status
* [10]252: Property Testing, by Antero MejrFinal: 2024-04-25Keywords:
[11]TestingSee also [12]SRFI 64: A Scheme API for test suites, [13]SRFI 158:
Generators and Accumulators, and [14]SRFI 194: Random data generators.
This defines an extension of the [15]SRFI 64 test suite API to support
property testing. It uses [16]SRFI 158 generators to generate test inputs,
which allows for the creation of custom input generators. It uses [17]SRFI
194 as the source of random data, so that the generation of random test
inputs can be made deterministic. For convenience, it also provides
procedures to create test input generators for the types specified in
R7RS-small. The interface to run property tests is similar to that of
[18]SRFI 64, and a property-testing-specific test runner is specified in
order to display the results of the propertized tests.
* [19]251: Mixing groups of definitions with expressions within bodies, by
Sergei EgorovFinal: 2024-05-06Keywords: [20]BindingSee also [21]SRFI 245:
Mixing definitions and expressions within bodies.
Scheme has traditionally required procedure bodies and the bodies of derived
constructs such as let to contain definitions followed by
commands/expressions. This SRFI proposes to allow mixing commands and groups
of definitions in such bodies, so that each command/expression is in the
scope of all local definition groups preceding it, but not in scope of the
local definition groups following it. This approach is backwards compatible
with R7RS and upholds the intuitive rule that to find the definition of a
lexical variable, one has to look up the source code tree.
* [22]250: Insertion-ordered hash tables, by John CowanDraft:
2023-11-14Keywords: [23]Data StructureSee also [24]SRFI 69: Basic hash
tables, [25]SRFI 125: Intermediate hash tables, [26]SRFI 126: R6RS-based
hashtables, and [27]SRFI 128: Comparators (reduced).
This SRFI defines an interface to hash tables, which are widely recognized as
a fundamental data structure for a wide variety of applications. A hash table
is a data structure that:
+ Is disjoint from all other types.
+ Provides a mapping from objects known as keys to corresponding objects
known as values.
o Keys may be any Scheme objects in some kinds of hash tables, but
are restricted in other kinds.
o Values may be any Scheme objects.
+ Provides an equality predicate which defines when a proposed key is the
same as an existing key. No table may contain more than one value for a
given key.
+ Provides a hash function which maps a candidate key into a non-negative
exact integer.
+ Supports mutation as the primary means of setting the contents of a
table.
+ Provides key lookup and destructive update in (expected) amortized
constant time, provided that a satisfactory hash function is available.
+ Does not guarantee that whole-table operations work in the presence of
concurrent mutation of the whole hash table. (Values may be safely
mutated.)
Unlike the hash tables of [28]SRFI 125, which is the direct ancestor of this
specification, the hash tables described here are ordered by insertion: that
is, associations inserted earlier in the history of the hash table appear
earlier in the ordering. Advances in the implementations of hash tables, as
provided by C++, Python, JavaScript, etc., make the provision of this new
facility practical. As a result, the hash tables of this SRFI do not
interoperate with the hash tables of SRFI 125, [29]SRFI 126, or existing R6RS
implementations.
* [30]249: Restarting conditions, by John CowanDraft: 2023-11-13Keywords:
[31]Exceptions
When an exceptional situation is encountered by a program, it may create a
condition object describing the situation and then signal the condition and
pass control to a condition handler. The signaler and handler are two
different parts of a system, between which there is a barrier of abstraction.
In order to recover gracefully and flexibly from exceptional situations,
however, the signaler can provide multiple ways by which the handler can
restart the computation, some of which may require extra input. Often, the
decision of which method of recovery to choose is left up to a human user,
who may be prompted for the input needed to recover. This SRFI proposes a
simple mechanism called restarters to encapsulate the information necessary
to restart a computation with associated interactive prompters.
* [32]248: Minimal delimited continuations, by Marc Nieper-WißkirchenDraft:
2023-10-29Keywords: [33]ContinuationsSee also [34]SRFI 226: Control Features.
Scheme's exception system is extended so that exception handlers gain access
to the delimited continuation representing the rest of the computation of the
call of the thunk guarded by the handler. Algebraic effect handlers can be
directly expressed in this extended exception system. The system directly
implements the shift0/reset0 delimited control operators. It is well known
that other delimited control operators like prompt0/control0 or reset/shift
are expressible in shift0/reset0 (and vice versa).
* [35]247: Syntactic Monads, by Marc Nieper-WißkirchenFinal:
2023-12-24Keywords: [36]Syntax
This SRFI extends Scheme with a simple mechanism to implicitly add formal
arguments to procedure definitions and to implicitly add arguments to
procedure calls. Contrary to parameters (also known as fluids or dynamically
bound variables), which can be used for the same purpose, no runtime overhead
is generated.
* [37]246: Guardians, by John CowanDraft: 2023-10-12Keywords: [38]Garbage
Collection
Guardians allow programs to protect objects from deallocation by the garbage
collector and to determine which objects would otherwise have been
deallocated. When the object has associated non-memory resources, a program
can register it with a guardian. The GC will mark inaccessible objects but
will not collect them; at the program's convenience, inaccessible objects are
removed from the guardian and their non-memory resources are disposed of.
Guardians allow objects to be saved from deallocation indefinitely so that
they can be reused or so that clean-up or other actions can be performed
using the data stored within the objects. Guardians avoid the problems
associated with classical finalizers detailed in the Rationale section.
* [39]245: Mixing definitions and expressions within bodies, by Daphne
Preston-KendalWithdrawn: 2024-04-04Keywords: [40]BindingSee also [41]SRFI
251: Mixing groups of definitions with expressions within bodies.
Scheme has traditionally required procedure bodies and the bodies of derived
constructs such as let to contain definitions followed by expressions. This
SRFI proposes to allow expressions to appear before and intermingled with
definitions in such bodies, as was allowed in program bodies by the R6RS and
in library bodies by R7RS small.
* [42]244: Multiple-value Definitions, by Marc Nieper-WißkirchenFinal:
2023-02-05Keywords: [43]Binding, [44]Multiple-Value ReturnsLibrary name:
define-values
A define-values form is a definition that binds multiple variables from a
single expression returning multiple values.
* [45]243: Unreadable Data, by Lassi KortelaWithdrawn: 2023-11-30Keywords:
[46]Reader Syntax
This SRFI suggests how the Scheme reader and writer should handle unreadable
data in general, and unreadable objects in particular.
* [47]242: The CFG Language, by Marc Nieper-WißkirchenFinal:
2023-10-29Keywords: [48]Control FlowLibrary name: cfgSee also [49]SRFI 42:
Eager Comprehensions.
This SRFI defines a language to describe control-flow graphs (CFGs) suitable
for formulating iterative and recursive algorithms. Using the notion of a CFG
term, this language can be seamlessly embedded in the Scheme language.
Complex CFG terms can be composed from simple CFG terms.
* [50]241: Match -- Simple Pattern-Matching Syntax to Express Catamorphisms on
Scheme Data, by Marc Nieper-WißkirchenFinal: 2023-03-23Keywords: [51]Pattern
Matching, [52]SyntaxLibrary name: matchSee also [53]SRFI 200: Pattern
Matching and [54]SRFI 204: Wright-Cartwright-Shinn Pattern Matcher.
This SRFI describes a simple pattern matcher based on one originally devised
by Kent Dybvig, Dan Friedman, and Eric Hilsdale, which has a catamorphism
feature to perform recursion automatically.
* [55]240: Reconciled Records, by Marc Nieper-WißkirchenFinal:
2023-05-02Keywords: [56]Data StructureSee also [57]SRFI 9: Defining Record
Types, [58]SRFI 57: Records, [59]SRFI 76: R6RS Records, [60]SRFI 99: ERR5RS
Records, [61]SRFI 131: ERR5RS Record Syntax (reduced), [62]SRFI 136:
Extensible record types, [63]SRFI 150: Hygienic ERR5RS Record Syntax
(reduced), and [64]SRFI 237: R6RS Records (refined).
This SRFI defines a version of the define-record-type definition of R^6RS and
[65]SRFI 237 that extends the define-record-type syntax of R^7RS, reconciling
both systems.
This SRFI is meant to be adopted by R^7RS-large to integrate essentially the
R^6RS record system compatibly with the existing R^7RS-small record system.
* [66]239: Destructuring Lists, by Marc Nieper-WißkirchenFinal:
2023-01-23Keywords: [67]SyntaxLibrary name: list-case
This SRFI provides the list-case, the syntactic fundamental list destructor.
* [68]238: Codesets, by Lassi KortelaFinal: 2023-01-16Keywords: [69]Operating
System, [70]Error Handling, [71]IntrospectionLibrary name: codesetsSee also
[72]SRFI 170: POSIX API, [73]SRFI 198: Foreign Interface Status, and [74]SRFI
199: POSIX errno manipulation.
Many programming interfaces rely on a set of condition codes where each code
has a numeric ID, a mnemonic symbol, and a human-readable message. This SRFI
defines a facility to translate between numbers and symbols in a codeset and
to fetch messages by code. Examples are given using the Unix errno and signal
codesets.
* [75]237: R6RS Records (refined), by Marc Nieper-WißkirchenFinal:
2023-05-02Keywords: [76]Data StructureSee also [77]SRFI 9: Defining Record
Types, [78]SRFI 57: Records, [79]SRFI 76: R6RS Records, [80]SRFI 99: ERR5RS
Records, [81]SRFI 131: ERR5RS Record Syntax (reduced), [82]SRFI 136:
Extensible record types, [83]SRFI 150: Hygienic ERR5RS Record Syntax
(reduced), and [84]SRFI 240: Reconciled Records.
The record mechanism of R^6RS is refined. In particular, the triad of record
names, record-type descriptors and record constructor descriptors can be
effectively ignored and replaced with the single notion of a record
descriptor. We also remove the restriction that the syntactic layer can only
define one constructor per record type defined.
* [85]236: Evaluating expressions in an unspecified order, by Marc
Nieper-WißkirchenFinal: 2022-11-22Keywords: [86]Control Flow,
[87]SyntaxLibrary name: independently
This SRFI defines the independently syntax, which can be used to combine side
effects into one expression without specifying their relative order.
* [88]235: Combinators, by John Cowan (spec) and Arvydas Silanskas
(implementation)Final: 2023-02-28Keywords: [89]Miscellaneous
This SRFI contains various procedures that accept and return procedures, as
well as a few others, drawn from [90]an earlier version of Chicken. Common
Lisp has a few of them too, and more come from [91]the Standard Prelude from
Programming Praxis. Using these procedures helps to keep code terse and
reduce the need for ad hoc lambdas.
* [92]234: Topological Sorting, by John Cowan and Arne BabenhauserheideDraft:
2022-08-10Keywords: [93]Algorithm
Topological sorting is an algorithm that takes a graph consisting of nodes
and other nodes that depend on them, forming a partial order, and returns a
list representing a total ordering of the graph. If the graph is cyclic, the
topological sort will fail. With the procedure topological-sort, failure
results in returning #false and additional information is provided via
multiple values. With topological-sort/exception, an error will be signalled
on failure. This SRFI includes utilities to operate on simple edgelists.
* [94]233: INI files, by John Cowan (spec) and Arvydas Silanskas
(implementation)Final: 2022-10-13Keywords: [95]I/O
An INI file is a configuration file that consists of key-value pairs for
properties, and sections that group the properties. The name of these
configuration files comes from the filename extension INI, short for
initialization. The format has become an informal standard in many contexts
of configuration. This SRFI provides access to the contents of an INI file.
* [96]232: Flexible curried procedures, by Wolfgang Corcoran-MatheFinal:
2022-04-06Keywords: [97]SyntaxSee also [98]SRFI 26: Notation for Specializing
Parameters without Currying and [99]SRFI 219: Define higher-order lambda.
Scheme lacks a flexible way to create and apply curried procedures. This SRFI
describes curried, a variant of lambda that creates true curried procedures
which also behave just like ordinary Scheme procedures. They can be applied
to their arguments one by one, all at once, or anywhere in between, without
any novel syntax. curried also supports nullary and variadic procedures, and
procedures created with it have predictable behavior when applied to surplus
arguments.
* [100]231: Intervals and Generalized Arrays, by Bradley J. LucierFinal:
2022-09-25Keywords: [101]Data Structure, [102]NumbersSee also [103]SRFI 122:
Nonempty Intervals and Generalized Arrays, [104]SRFI 164: Enhanced
multi-dimensional Arrays, and [105]SRFI 179: Nonempty Intervals and
Generalized Arrays (Updated).
This SRFI specifies an array mechanism for Scheme. Arrays as defined here are
quite general; at their most basic, an array is simply a mapping, or
function, from multi-indices of exact integers $i_0,\ldots,i_{d-1}$ to Scheme
values. The set of multi-indices $i_0,\ldots,i_{d-1}$ that are valid for a
given array form the domain of the array. In this SRFI, each array's domain
consists of the cross product of intervals of exact integers
$[l_0,u_0)\times[l_1,u_1)\times\cdots\times[l_{d-1},u_{d-1})$ of $\mathbb
Z^d$, $d$-tuples of integers. Thus, we introduce a data type called
$d$-intervals, or more briefly [106]intervals, that encapsulates this notion.
(We borrow this terminology from, e.g., Elias Zakon's [107]Basic Concepts of
Mathematics.) Specialized variants of arrays provide portable programs with
efficient representations for common use cases.
This is a revised and improved version of [108]SRFI 179.
* [109]230: Atomic Operations, by Marc Nieper-WißkirchenFinal:
2021-11-15Keywords: [110]ConcurrencySee also [111]SRFI 18: Multithreading
support and [112]SRFI 226: Control Features.
This SRFI defines atomic operations for the Scheme programming language. An
atomic operation is an operation that, even in the presence of multiple
threads, is either executed completely or not at all. Atomic operations can
be used to implement mutexes and other synchronization primitives, and they
can be used to make concurrent algorithms lock-free. For this, this SRFI
defines two data types, atomic flags and atomic (fixnum) boxes, whose
contents can be queried and mutated atomically. Moreover, each atomic
operation comes with a memory order that defines the level of synchronization
with other threads.
* [113]229: Tagged Procedures, by Marc Nieper-WißkirchenFinal:
2021-11-15Keywords: [114]Data Structure
This SRFI defines tagged procedures, which are procedures that are tagged
with a Scheme value when created through the syntax lambda/tag and
case-lambda/tag. The value of the tag of a procedure can be retrieved with
procedure-tag, and the predicate procedure/tag? discerns whether a procedure
is tagged.
* [115]228: Composing Comparators, by Daphne Preston-KendalFinal:
2022-12-10Keywords: [116]ComparisonSee also [117]SRFI 128: Comparators
(reduced) and [118]SRFI 162: Comparators sublibrary.
Further procedures for defining [119]SRFI 128 comparators.
Best enjoyed in combination with [120]SRFI 162.
* [121]227: Optional Arguments, by Marc Nieper-Wißkirchen (spec and R6RS
implementation) and Daphne Preston-Kendal (R7RS implementation)Final:
2021-11-16Keywords: [122]BindingSee also [123]SRFI 89: Optional positional
and named parameters.
This SRFI specifies the opt-lambda syntax, which generalizes lambda. An
opt-lambda expression evaluates to a procedure that takes a number of
required and a number of optional (positional) arguments whose default values
are determined by evaluating corresponding expressions when the procedure is
called.
This SRFI also specifies a variation opt*-lambda, which is to opt-lambda as
let* is to let and the related binding constructs let-optionals and
let-optionals*.
Finally, for those who prefer less explicit procedure definitions, a
sublibrary provides define-optionals and define-optionals*.
* [124]226: Control Features, by Marc Nieper-WißkirchenFinal:
2023-04-25Keywords: [125]Continuations, [126]Control FlowSee also [127]SRFI
18: Multithreading support, [128]SRFI 34: Exception Handling for Programs,
[129]SRFI 39: Parameter objects, [130]SRFI 45: Primitives for Expressing
Iterative Lazy Algorithms, [131]SRFI 97: SRFI Libraries, [132]SRFI 154:
First-class dynamic extents, [133]SRFI 155: Promises, [134]SRFI 157:
Continuation marks, and [135]SRFI 158: Generators and Accumulators.
Whenever an expression is evaluated during the run of a Scheme program, there
is a continuation awaiting the values of the expression. It is a
distinguishing property of the Scheme programming language to offer a
procedure (named call/cc) that captures the current continuation as a
procedure, which, when called, aborts the then-current continuation and
reinstates the captured one.
One can visualize a continuation as a list of (continuation) frames where a
non-tail call adds a frame to the top of the list and where the return from a
non-tail call removes the appropriate frame.
Moreover, each expression is evaluated in a dynamic environment that
conceptually holds the values of parameters like the current output port and
the dynamic-wind stack at the point of evaluation. As the dynamic environment
is captured and reinstated along the continuation when the call/cc machinery
is used, we can view it conceptually as part of the continuation.
The libraries defined in this SRFI are all concerned with continuations in a
wider sense. More specifically, the topics are as follows:
Continuation Prompts
A continuation prompt is a special continuation frame that is tagged
with a so-called prompt tag. Procedures to install continuation
prompts and to abort the current continuation and escape back to a
previously installed continuation prompt are provided. Moreover,
continuation prompts are equipped with handlers that are invoked
when a continuation is aborted to them.
Continuations
When continuations are captured, the list of captured continuation
frames is always delimited by some continuation prompt. This extends
the semantics of Scheme's call-with-current-continuation. Moreover,
a procedure to capture so-called composable continuations is
provided. As opposed to continuations captured by
call-with-current-continuation, invoking a composable continuation
does not abort the then-current continuation, so composable
continuations behave like ordinary procedures. Together with
continuation prompts, composable continuations allow one to
implement the various proposed sets of control operators for
delimited continuations. Finally, a primitive (call-in-continuation)
is provided that allows calling a procedure in a given continuation
instead of just delivering values to it.
Continuation Marks
Continuation marks are a provided feature that allows one to attach
arbitrary information to continuation frames that is captured and
reinstated along with the rest of the continuation. Conceptually,
exception handlers and parameters are implemented in terms of
continuation marks, but the syntax and procedures defined in this
SRFI allow the user to use them in more general ways. Moreover, they
reify the notion of a tail call, allowing one, for example, to test
for tail context.
Exceptions
The exception mechanism of [136]R6RS and [137]R7RS is reinterpreted
with respect to the concepts introduced in this SRFI. (Here, and in
what follows we mean the so-called small language when we speak
about R7RS.) Moreover, the with-exception-handler procedure and the
guard syntax gain additional tail-context guarantees.
Parameters
The parameter object mechanism of [138]SRFI 39 and R7RS is
reinterpreted with respect to the concepts introduced in this SRFI.
Procedures to retrieve the current parameterization and to reinstall
it later are provided. Moreover, the parameterize syntax gains an
additional tail-context guarantee. To support an alternative model
of parameters that is linked to the dynamic extent and not to the
current parameterization, the notion of a parameter-like object and
the temporarily syntax are introduced.
Fluids
Fluids are a syntactic reinterpretation of parameter objects.
Delayed evaluation
The syntax and procedures on delayed evaluation of R7RS are
revisited and redefined to handle the following satisfactorily: the
parameterization of the delayed expression being forced, the
treatment of exceptions raised during forcing of delayed
expressions, and iterative lazy algorithms. Moreover, their
semantics are detailed with respect to the concepts introduced in
this SRFI, and promises can naturally deliver an arbitrary number of
values when being forced. Finally, the initial continuation of a
delayed expression being forced is defined in a way that makes it
interchangeable with the initial continuation of a thread.
Threads
The thread mechanism of [139]SRFI 18 is detailed with respect to the
concepts introduced in this SRFI. In particular, mutation of
parameter objects in multi-threaded applications is specified. In
order to support timeout arguments in a type-safe way, a minimal API
on time objects is included as well.
Large parts of this SRFI have been inspired by the control operators provided
by [140]Racket.
* [141]225: Dictionaries, by John Cowan (spec) and Arvydas Silanskas
(implementation)Final: 2022-09-27Keywords: [142]Data StructureSee also
[143]SRFI 146: Mappings and [144]SRFI 167: Ordered Key Value Store.
The procedures of this SRFI allow callers to manipulate an object that maps
keys to values without the caller needing to know exactly what the type of
the object is. Such an object is called a dictionary or dict in this SRFI.
* [145]224: Integer Mappings, by Wolfgang Corcoran-MatheFinal:
2021-06-30Keywords: [146]Data StructureSee also [147]SRFI 146: Mappings and
[148]SRFI 189: Maybe and Either: optional container types.
Integer maps, or fxmappings, are finite sets, where each element is an
association between a fixnum (exact integer) key and an arbitrary Scheme
object. They are similar to the general mappings of [149]SRFI 146, but the
restricted key-type allows implementations of fxmappings to benefit from
optimized structures and algorithms. This library provides a rich set of
operations on fxmappings, including analogues of most of the forms provided
by SRFI 146. Fxmappings have no intrinsic order, but may be treated as
ordered sets, using the natural ordering on keys; a substantial sublibrary
for working with fxmappings in this fashion is included.
* [150]223: Generalized binary search procedures, by Daphne
Preston-KendalFinal: 2021-07-27Keywords: [151]MiscellaneousSee also [152]SRFI
43: Vector library and [153]SRFI 133: Vector Library (R7RS-compatible).
Generalized procedures for binary search of vector-like data structures are
provided which can be applied to any sequence type, including ones defined by
the user, together with applications of these procedures for Scheme's
built-in vectors.
* [154]222: Compound Objects, by John Cowan (text) and Arvydas Silanskas
(implementation)Final: 2021-07-20Keywords: [155]Data Structure
Compound objects are analogous to R6RS compound conditions, and are suitable
for use in creating and handling conditions on non-R6RS systems, among other
purposes. They encapsulate an immutable sequence of subobjects, which can be
any object except another compound object. It is possible to implement R6RS
compound conditions on top of compound objects, but not vice versa. Note that
this SRFI does not provide any analogue to R6RS simple conditions, which are
just records.
* [156]221: Generator/accumulator sub-library, by John Cowan (text) and Arvydas
Silanskas (implementation)Final: 2021-05-28Keywords: [157]Data StructureSee
also [158]SRFI 158: Generators and Accumulators.
This is a set of convenience routines for generators and accumulators
intended to blend in with [159]SRFI 158. The authors recommend that they be
added to the (srfi 158) library provided by users or implementations. If they
are approved by the R7RS-large process, they can also be added to (r7rs
generator).
* [160]220: Line directives, by Lassi KortelaWithdrawn: 2021-04-20Keywords:
[161]Reader Syntax
Many language-agnostic programming tools rely on specially formatted source
code comments to annotate the code with metadata. Such "magic comments" are
hard for both humans and computers to parse reliably, as the purpose of a
comment is to be free-form text that is not interpreted by machine.
This SRFI extends the standard Scheme directive syntax (#!) to support line
directives. They look like magic comments to language-agnostic tools but read
as S-expressions in Scheme, combining the portability of magic comments with
the well-defined syntax and easy parsing of ordinary Scheme code.
* [162]219: Define higher-order lambda, by Lassi KortelaFinal:
2021-04-04Keywords: [163]Binding, [164]SyntaxLibrary name: defineSee also
[165]SRFI 201: Syntactic Extensions to the Core Scheme Bindings and [166]SRFI
232: Flexible curried procedures.
This SRFI codifies the following shorthand syntax, which some Scheme
implementations have had for a long time.
(define ((outer-name outer-args ...) inner-args ...) inner-body ...)
* [167]218: Unicode Numerals, by John Cowan (text) and Arvydas Silanskas
(implementation)Withdrawn: 2021-01-30Keywords: [168]Internationalization
These procedures allow the creation and interpretation of numerals using any
set of Unicode digits that support positional notation.
* [169]217: Integer Sets, by John Cowan (text) and Wolfgang Corcoran-Mathe
(implementation)Final: 2021-02-15Keywords: [170]Data StructureSee also
[171]SRFI 113: Sets and bags.
Integer sets, or isets, are unordered collections of fixnums. (Fixnums are
exact integers within certain implementation-specified bounds.)
* [172]216: SICP Prerequisites (Portable), by Vladimir NikishkinFinal:
2021-01-21Keywords: [173]SICPSee also [174]SRFI 203: A Simple Picture
Language in the Style of SICP.
This SRFI follows [175]SRFI 203 in providing "out-of-the-box" support for
hosting the exercises suggested by [176]Structure and Interpretation of
Computer Programs in portable Scheme.
Whereas SRFI 203 focused on the necessarily non-portable aspects of the
problem set (the graphics), this SRFI aims to provide support for the rest of
the features, which are far more widespread, often already provided, and in
reality mostly need just a common vocabulary.
This SRFI provides procedures for working with time data, multi-threading,
and streams, as well as SICP names for true and false.
None of these procedures is fit for production use. They are only designed
for pedagogical purposes.
Students, however, are expected to be able to just write
(include (srfi sicp))
and have the code from the book run without problems (apart from those
intended by the book authors).
* [177]215: Central Log Exchange, by Göran WeinholtFinal: 2021-01-11Keywords:
[178]Operating SystemLibrary name: logging
This SRFI specifies a central log exchange for Scheme that connects log
producers with log consumers. It allows multiple logging systems to
interoperate and co-exist in the same program. Library code can produce log
messages without knowledge of which log system is actually used. Simple
applications can easily get logs on standard output, while more advanced
applications can send them to a full logging system.
* [179]214: Flexvectors, by Adam NelsonFinal: 2021-03-18Keywords: [180]Data
StructureSee also [181]SRFI 117: Queues based on lists, [182]SRFI 125:
Intermediate hash tables, [183]SRFI 133: Vector Library (R7RS-compatible),
[184]SRFI 134: Immutable Deques, and [185]SRFI 158: Generators and
Accumulators.
A flexvector, also known as a dynamic array or an arraylist, is a mutable
vector-like data structure with an adjustable size. Flexvectors allow fast
random access and fast insertion/removal at the end. This SRFI defines a
suite of operations on flexvectors, modeled after [186]SRFI 133's vector
operations.
* [187]213: Identifier Properties, by Marc Nieper-WißkirchenFinal:
2021-03-21Keywords: [188]Binding, [189]Syntax
Using the define-property definition described in this SRFI, expand-time
properties can be associated with identifiers in a referentially transparent
and lexically scoped way.
* [190]212: Aliases, by Marc Nieper-WißkirchenFinal: 2021-02-12Keywords:
[191]Syntax
This SRFI introduces alias definitions, a syntactic extension. An alias
definition transfers the binding of one identifier to another, effectively
aliasing the identifier.
* [192]211: Scheme Macro Libraries, by Marc Nieper-WißkirchenFinal:
2022-07-19Keywords: [193]SyntaxSee also [194]SRFI 46: Basic Syntax-rules
Extensions, [195]SRFI 93: R6RS Syntax-Case Macros, and [196]SRFI 139: Syntax
parameters.
This SRFI describes common syntactic extensions of the syntax-rules macro
facility of R5RS and the base R6RS and R7RS libraries. In particular, library
namespaces are defined where these extensions can be located and which can be
tested against in cond-expand forms.
* [197]210: Procedures and Syntax for Multiple Values, by Marc
Nieper-WißkirchenFinal: 2021-02-12Keywords: [198]Binding, [199]Multiple-Value
ReturnsSee also [200]SRFI 8: receive: Binding to multiple values, [201]SRFI
11: Syntax for receiving multiple values, and [202]SRFI 71: Extended
LET-syntax for multiple values.
This SRFI extends the Scheme standard with procedures and syntax dealing with
multiple values, including syntax to create lists and vectors from
expressions returning multiple values and procedures returning the elements
of a list or vector as multiple values.
* [203]209: Enums and Enum Sets, by John Cowan (text) and Wolfgang
Corcoran-Mathe (implementation)Final: 2020-12-17Keywords: [204]Data Structure
Enums are objects that serve to form sets of distinct classes that specify
different modes of operation for a procedure. Their use fosters portable and
readable code.
* [205]208: NaN procedures, by Emmanuel Medernach (design), John Cowan
(editor), and Wolfgang Corcoran-Mathe (implementation)Final:
2021-02-23Keywords: [206]Data Structure, [207]Numbers
This SRFI provides procedures that dissect NaN (Not a Number) inexact values.
* [208]207: String-notated bytevectors, by Daphne Preston-Kendal (external
notation), John Cowan (procedure design), and Wolfgang Corcoran-Mathe
(implementation)Final: 2020-10-29Keywords: [209]Reader Syntax
To ease the human reading and writing of Scheme code involving binary data
that for mnemonic reasons corresponds as a whole or in part to ASCII-coded
text, a notation for bytevectors is defined which allows printable ASCII
characters to be used literally without being converted to their
corresponding integer forms. In addition, this SRFI provides a set of
procedures known as the bytestring library for constructing a bytevector from
a sequence of integers, characters, strings, and/or bytevectors, and for
manipulating bytevectors as if they were strings as far as possible.
* [210]206: Auxiliary Syntax Keywords, by Marc Nieper-WißkirchenFinal:
2020-12-21Keywords: [211]SyntaxSee also [212]SRFI 139: Syntax parameters and
[213]SRFI 213: Identifier Properties.
This SRFI defines a mechanism for defining auxiliary syntax keywords
independently in different modules in such a way that they still have the
same binding so that they can be used interchangeably as literal identifiers
in syntax-rules and syntax-case expressions and can be both imported under
the same name without conflicts.
* [214]205: POSIX Terminal Fundamentals, by John Cowan and Harold
AncellWithdrawn: 2022-03-21Keywords: [215]Operating SystemSee also [216]SRFI
170: POSIX API and [217]SRFI 198: Foreign Interface Status.
This SRFI describes procedures for command-line and terminal interface
programs to safely change and reset terminal modes, for example from cooked
to raw and back, and for serial-line device manipulation for interfacing with
embedded hardware and the like.
It is intended to provide all the [218]termios structure functionality a
modern Scheme programmer might desire by supplying a [219]stty procedure, and
simple abstractions on top of it.
* [220]204: Wright-Cartwright-Shinn Pattern Matcher, by Felix
ThibaultWithdrawn: 2022-02-02Keywords: [221]Pattern MatchingSee also
[222]SRFI 200: Pattern Matching and [223]SRFI 201: Syntactic Extensions to
the Core Scheme Bindings.
Pattern matching decomposes a compound data structure into parts and assigns
those parts to variables. This SRFI describes a pattern-matching library
already in use by several scheme implementations which can match many common
compound data structures.
* [224]203: A Simple Picture Language in the Style of SICP, by Vladimir
NikishkinFinal: 2020-09-17Keywords: [225]SICPSee also [226]SRFI 216: SICP
Prerequisites (Portable).
This SRFI proposes a simple library for programmatic drawing of pictures
compatible with Section 2.2.4 of Structure and Interpretation of Computer
Programs.
It aims to close the gap between the Scheme suggested for study in the book
and portable Scheme.
* [227]202: Pattern-matching Variant of the and-let* Form that Supports
Multiple Values, by Panicz Maciej GodekFinal: 2020-11-28Keywords:
[228]Binding, [229]Control Flow, [230]Pattern MatchingSee also [231]SRFI 2:
AND-LET*: an AND with local bindings, a guarded LET* special form and
[232]SRFI 200: Pattern Matching.
The SRFI-2 library introduced the and-let* form for short-circuited
evaluation in the style of the and form, with the ability to capture the
(non-#f) results in the style of the let* form. This document extends the
and-let* form with the ability to pattern-match (or "destructurally bind")
the values of evaluated expressions (where the match failure causes
short-circuiting rather than raising an error) and the ability to handle
multiple values (where only the falsehood of the first value causes
short-circuiting).
* [233]201: Syntactic Extensions to the Core Scheme Bindings, by Panicz Maciej
GodekFinal: 2021-01-13Keywords: [234]Binding, [235]Pattern Matching,
[236]SyntaxSee also [237]SRFI 8: receive: Binding to multiple values,
[238]SRFI 11: Syntax for receiving multiple values, [239]SRFI 71: Extended
LET-syntax for multiple values, [240]SRFI 200: Pattern Matching, and
[241]SRFI 219: Define higher-order lambda.
This document describes a handful of syntactic extensions to the core
bindings of the Scheme programming language. In particular, it proposes to
extend the binding forms lambda, let, let* with pattern matching
capabilities, to extend the forms let and or with the ability to handle
multiple values, and to extend the form define with the ability of defining
"curried" functions.
* [242]200: Pattern Matching, by Panicz Maciej GodekWithdrawn:
2022-07-23Keywords: [243]Pattern Matching
This SRFI discusses some of the existing pattern-matching libraries for the
Scheme programming language -- namely, the pattern matcher presented by
Andrew K. Wright and Robert Cartwright in the paper "A Soft Type System for
Scheme", the pattern matcher developed by Dan Friedman, Erik Hilsdale and
Kent Dybvig, the racket/match module distributed with the Racket programming
environment, as well as the Bigloo and Gerbil pattern matchers distributed
with their respective implementations. It then extracts a pattern syntax
which is compatible with three of those implementations and provides
extrinsic rationale for that syntax. It also provides a simple implementation
of a pattern matcher which conforms to the specification of a pattern
language provided in this document.
* [244]199: POSIX errno manipulation, by Harold AncellWithdrawn:
2020-07-19Keywords: [245]Error Handling, [246]Operating SystemSee also
[247]SRFI 170: POSIX API and [248]SRFI 198: Foreign Interface Status.
The majority of POSIX system and library calls require accessing errno to
discern the specific cause of an error, and some require setting it to 0
before being called. This SRFI specifies procedures to both retrieve its
value, and to set it.
* [249]198: Foreign Interface Status, by John Cowan (editor and shepherd),
Harold Ancell (implementer and editor), and Lassi Kortela
(architect)Withdrawn: 2020-09-12Keywords: [250]Error Handling, [251]Operating
SystemSee also [252]SRFI 170: POSIX API.
This SRFI provides means to construct, return or signal, and extract
information from Scheme interfaces with "foreign" systems such as the POSIX
API, databases, and libraries.
* [253]197: Pipeline Operators, by Adam NelsonFinal: 2020-09-12Keywords:
[254]Syntax
Many functional languages provide pipeline operators, like Clojure's -> or
OCaml's |>. Pipelines are a simple, terse, and readable way to write
deeply-nested expressions. This SRFI defines a family of chain and nest
pipeline operators, which can rewrite nested expressions like (a b (c d (e f
g))) as a sequence of operations: (chain g (e f _) (c d _) (a b _)).
* [255]196: Range Objects, by John Cowan (text) and Wolfgang Corcoran-Mathe
(sample implementation)Final: 2020-09-17Keywords: [256]Data StructureSee also
[257]SRFI 42: Eager Comprehensions.
Ranges are collections somewhat similar to vectors, except that they are
immutable and have algorithmic representations instead of the uniform
per-element data structure of vectors. The storage required is usually less
than the size of the same collection stored in a vector and the time needed
to reference a particular element is typically less for a range than for the
same collection stored in a list. This SRFI defines a large subset of the
sequence operations defined on lists, vectors, strings, and other
collections. If necessary, a range can be converted to a list, vector, or
string of its elements or a generator that will lazily produce each element
in the range.
* [258]195: Multiple-value boxes, by Marc Nieper-WißkirchenFinal:
2020-08-28Keywords: [259]Data Structure, [260]Multiple-Value ReturnsSee also
[261]SRFI 111: Boxes and [262]SRFI 189: Maybe and Either: optional container
types.
This SRFI extends the specification of the boxes of [263]SRFI 111 so that
they are multiple-values aware. Whereas a SRFI 111 box is limited in that it
can only box a single value, multiple values can be boxed with this SRFI.
* [264]194: Random data generators, by Shiro Kawai (design), Arvydas Silanskas
(implementation), John Cowan (editor and shepherd), and Linas Vepstas
(implementation)Final: 2020-08-26Keywords: [265]RandomnessSee also [266]SRFI
27: Sources of Random Bits.
This SRFI defines a set of [267]SRFI 158 generators and generator makers that
yield random data of specific ranges and distributions. It is intended to be
implemented on top of [268]SRFI 27, which provides the underlying source of
random integers and floats.
* [269]193: Command line, by Lassi KortelaFinal: 2020-09-10Keywords:
[270]Operating SystemSee also [271]SRFI 22: Running Scheme Scripts on Unix.
R^6RS and R^7RS define a command-line procedure. While a useful baseline, the
specification is not detailed enough to cover all practical situations. This
SRFI clarifies the definition of command-line and adds a few related
procedures. Scheme scripts, standalone executables, compilation and REPL use
are accounted for. Option parsing is out of scope.
* [272]192: Port Positioning, by John Cowan and Shiro Kawai (implementation;
requires a hook)Based on R6RS.Final: 2020-07-31Keywords: [273]I/OSee also
[274]SRFI 181: Custom ports (including transcoded ports).
This is an extract from the R6RS that documents its support for positioning
ports. Binary ports can be positioned to read or write at a specific byte;
textual ports at a specific character, although character positions can't be
synthesized portably. It has been lightly edited to fit R7RS style.
* [275]191: Procedure Arity Inspection, by John CowanBased on SRFI
102.Withdrawn: 2020-07-05Keywords: [276]IntrospectionSee also [277]SRFI 102:
Procedure Arity Inspection and [278]SRFI 151: Bitwise Operations.
Many Scheme systems provide mechanisms for inspecting the arity of a
procedural value, making it a common feature, however there is no standard
interface. As a result there is no portable way to observe the arity of a
procedure without actually applying it. This SRFI proposes a simple interface
that is consistent with existing Scheme systems' facilities and prior
proposals.
* [279]190: Coroutine Generators, by Marc Nieper-WißkirchenFinal:
2020-06-11Keywords: [280]SyntaxSee also [281]SRFI 121: Generators, [282]SRFI
139: Syntax parameters, and [283]SRFI 158: Generators and Accumulators.
This SRFI defines syntax to create [284]SRFI 121/[285]158 coroutine
generators conveniently and in the flavor of Python generator functions.
* [286]189: Maybe and Either: optional container types, by John Cowan (text)
and Wolfgang Corcoran-Mathe (sample implementation)Final: 2020-07-14Keywords:
[287]Data Structure, [288]Multiple-Value ReturnsSee also [289]SRFI 195:
Multiple-value boxes.
This SRFI defines two disjoint immutable container types known as Maybe and
Either, both of which can contain objects collectively known as their
payload. A Maybe object is either a Just object or the unique object Nothing
(which has no payload); an Either object is either a Right object or a Left
object. Maybe represents the concept of optional values; Either represents
the concept of values which are either correct (Right) or errors (Left).
Note that the terms Maybe, Just, Nothing, Either, Right, and Left are
capitalized in this SRFI so as not to be confused with their ordinary use as
English words. Thus "returns Nothing" means "returns the unique Nothing
object"; "returns nothing" could be interpreted as "returns no values" or
"returns an unspecified value".
* [290]188: Splicing binding constructs for syntactic keywords, by Marc
Nieper-WißkirchenFinal: 2020-06-03Keywords: [291]SyntaxSee also [292]SRFI 93:
R6RS Syntax-Case Macros and [293]SRFI 148: Eager syntax-rules.
Splicing binding constructs for syntactic keywords are versions of let-syntax
and letrec-syntax that can be used in a definition context in the same way as
begin.
* [294]187: ALAMBDA and ADEFINE, by Joo ChurlSooBased on SRFI 92.Withdrawn:
2020-03-27Keywords: [295]Miscellaneous, [296]Type CheckingSee also [297]SRFI
92: ALAMBDA and ALAMBDA* and [298]SRFI 182: ADBMAL, ALET, and ALET*.
This SRFI introduces alambda, which creates a procedure that checks its
actual arguments, takes various types of required and optional variables.
This SRFI is based on [299]SRFI 92 as an extension of the optional arguments
of [300]SRFI 182.
* [301]186: Transcoders and transcoded ports, by John CowanBased on
R6RS.Withdrawn: 2020-09-08Keywords: [302]I/O, [303]SupersededSee also
[304]SRFI 80: Stream I/O, [305]SRFI 81: Port I/O, and [306]SRFI 181: Custom
ports (including transcoded ports).
This is an extract from the R6RS that documents its support for transcoders
and transcoded ports. These provide a hook into the Scheme port system from
below, allowing the creation of textual ports that provide non-default
encoding and decoding from arbitrary binary ports. It has been lightly edited
to fit R7RS style.
* [307]185: Linear adjustable-length strings, by John CowanFinal:
2020-04-26Keywords: [308]Data StructureSee also [309]SRFI 13: String
Libraries, [310]SRFI 118: Simple adjustable-size strings, [311]SRFI 130:
Cursor-based string library, [312]SRFI 140: Immutable Strings, and [313]SRFI
152: String Library (reduced).
Scheme specifies mutable fixed-length strings. [314]SRFI 118 adds two
procedures, string-append! and string-replace!, which allow the length of the
string to change. This SRFI provides two linear-update versions of these
procedures: that is, the implementation may change the string length or
return a new string instead. In addition, two convenience macros are provided
that make the procedures somewhat easier to use.
* [315]184: define-record-lambda, by Joo ChurlSooWithdrawn: 2020-03-27Keywords:
[316]Data StructureSee also [317]SRFI 9: Defining Record Types and [318]SRFI
100: define-lambda-object.
This SRFI introduces a macro, DEFINE-RECORD-LAMBDA, that defines a set of
procedures, that is, a group of constructors and a predicate. The
constructors also make a group of procedures, namely record lambdas, that
have no explicit field accessors and mutators. They can have various kinds of
fields, such as common fields, required fields, optional fields, automatic
fields, read-only fields, read-write fields, invisible fields, immutable
fields, and virtual fields.
* [319]183: Another format procedure, Fox, by Joo ChurlSooWithdrawn:
2020-03-27Keywords: [320]I/OSee also [321]SRFI 54: Formatting.
This SRFI introduces the formatting procedure Fox ("format of X"), which
takes one required argument and a variable number of additional arguments and
returns a formatted string.
* [322]182: ADBMAL, ALET, and ALET*, by Joo ChurlSooWithdrawn:
2020-03-27Keywords: [323]Data Structure, [324]Multiple-Value ReturnsSee also
[325]SRFI 2: AND-LET*: an AND with local bindings, a guarded LET* special
form, [326]SRFI 11: Syntax for receiving multiple values, [327]SRFI 51:
Handling rest list, [328]SRFI 54: Formatting, [329]SRFI 71: Extended
LET-syntax for multiple values, and [330]SRFI 86: MU and NU simulating VALUES
& CALL-WITH-VALUES, and their related LET-syntax.
Unlike the VALUES and CALL-WITH-VALUES mechanism of R5RS, this one uses an
explicit representation for multiple return values as a single value, namely
a procedure. Decomposition of multiple values is done by simple application.
The macro, ADBMAL, evaluates to a procedure that takes one procedure
argument. The ADBMAL macro can be compared with LAMBDA. While a LAMBDA
expression that consists of and requires some actual
arguments later when the evaluated LAMBDA expression is called, an ADBMAL
expression that consists of s corresponding to actual arguments
of LAMBDA requires and , that is, an evaluated LAMBDA
expression, later when the evaluated ADBMAL expression is called.
This SRFI also introduces the new LET-syntax ALET and ALET*, which depend on
ADBMAL to manipulate multiple values, and which are compatible with LET and
LET* of R5RS in single-value bindings. They also have a binding form making
use of VALUES and CALL-WITH-VALUES to handle multiple values, and new binding
forms for list, cons, and other multiple values. In addition, they have
several new binding forms for useful functions such as escape, iteration,
optional arguments, etc.
* [331]181: Custom ports (including transcoded ports), by John CowanBased on
R6RS.Final: 2020-09-08Keywords: [332]I/OSee also [333]SRFI 79: Primitive I/O,
[334]SRFI 81: Port I/O, [335]SRFI 82: Stream Ports, [336]SRFI 91: Extended
ports, [337]SRFI 186: Transcoders and transcoded ports, and [338]SRFI 192:
Port Positioning.
This SRFI is derived from parts of [339]library section 8.2.4, [340]library
section 8.2.7, [341]library section 8.2.10, and [342]library section 8.2.13
of the R6RS. These sections are themselves based on parts of [343]SRFI 79,
[344]SRFI 80 and [345]SRFI 81. These procedures provide a hook into the
Scheme port system from below, allowing the creation of custom ports that
behave as much as possible like the standard file, string, and bytevector
ports, but that call a procedure to produce data to input ports or to consume
data from output ports. Procedures for creating ports that transcode between
bytes and characters are an important special case and are also documented in
this SRFI.
* [346]180: JSON, by Amirouche BoubekkiFinal: 2020-07-01Keywords: [347]I/O
This library describes a JavaScript Object Notation (JSON) parser and
printer. It supports JSON that may be bigger than memory.
* [348]179: Nonempty Intervals and Generalized Arrays (Updated), by Bradley J.
LucierFinal: 2020-06-30Keywords: [349]Data Structure, [350]NumbersSee also
[351]SRFI 122: Nonempty Intervals and Generalized Arrays, [352]SRFI 164:
Enhanced multi-dimensional Arrays, and [353]SRFI 231: Intervals and
Generalized Arrays.
This SRFI specifies an array mechanism for Scheme. Arrays as defined here are
quite general; at their most basic, an array is simply a mapping, or
function, from multi-indices of exact integers $i_0,\ldots,i_{d-1}$ to Scheme
values. The set of multi-indices $i_0,\ldots,i_{d-1}$ that are valid for a
given array form the domain of the array. In this SRFI, each array's domain
consists of the cross product of nonempty intervals of exact integers
$[l_0,u_0)\times[l_1,u_1)\times\cdots\times[l_{d-1},u_{d-1})$ of $\mathbb
Z^d$, $d$-tuples of integers. Thus, we introduce a data type called
$d$-intervals, or more briefly intervals, that encapsulates this notion. (We
borrow this terminology from, e.g., Elias Zakon's [354]Basic Concepts of
Mathematics.) Specialized variants of arrays are specified to provide
portable programs with efficient representations for common use cases.
* [355]178: Bitvector library, by John Cowan (text) and Wolfgang Corcoran-Mathe
(implementation)Final: 2020-08-25Keywords: [356]Data StructureSee also
[357]SRFI 151: Bitwise Operations and [358]SRFI 160: Homogeneous numeric
vector libraries.
This SRFI describes a set of operations on homogeneous bitvectors. Operations
analogous to those provided on the other homogeneous vector types described
in [359]SRFI 160 are provided, along with operations analogous to the bitwise
operations of [360]SRFI 151.
* [361]177: Portable keyword arguments, by Lassi KortelaWithdrawn:
2020-07-31Keywords: [362]BindingSee also [363]SRFI 88: Keyword objects and
[364]SRFI 89: Optional positional and named parameters.
Many Scheme implementations have keyword arguments, but they have not been
widely standardized. This SRFI defines the macros lambda/kw and call/kw. They
can be used identically in every major implementation currently in use,
making it safe to use keyword arguments in portable code. The macros expand
to native keyword arguments in Schemes that have them, letting programmers
mix portable code and implementation-specific code.
* [365]176: Version flag, by Lassi KortelaFinal: 2020-02-24Keywords:
[366]Operating SystemLibrary name: version
This SRFI defines a standard command-line flag to get version information
from a Scheme implementation. The output is Line-oriented S-expressions which
are easy to parse from Scheme, C, and shell scripts and can co-exist with
non-S-expression output. A standard vocabulary is defined; extensions are
easy to make.
* [367]175: ASCII character library, by Lassi KortelaFinal: 2019-12-20Keywords:
[368]Data StructureLibrary name: ascii
This SRFI defines ASCII-only equivalents to many of the character procedures
in standard Scheme plus a few extra ones. Recent Scheme standards are based
around Unicode but the significant syntactic elements in many file formats
and network protocols are all ASCII. Such low-level code can run faster and
its behavior can be easier to understand when it uses ASCII primitives.
* [369]174: POSIX Timespecs, by John CowanFinal: 2019-12-21Keywords: [370]Data
StructureSee also [371]SRFI 19: Time Data Types and Procedures and [372]SRFI
170: POSIX API.
This SRFI defines the trivial type timespec, which is used to represent the
struct timespec defined by the [373]POSIX header.
* [374]173: Hooks, by Amirouche BoubekkiFinal: 2019-10-24Keywords:
[375]Miscellaneous
This library describes a mechanism known as hooks. Hooks are a certain kind
of extension point in a program that allows interleaving the execution of
arbitrary code with the execution of the program without introducing any
coupling between the two.
* [376]172: Two Safer Subsets of R7RS, by John CowanFinal: 2019-11-10Keywords:
[377]Miscellaneous
This SRFI provides two libraries for use with R7RS that provide a way to
sandbox the eval procedure to make it safer to use in evaluating Scheme
expressions of doubtful provenance. The intention is to call eval, passing it
an S-expression representing a Scheme procedure and the environment defined
by one of these libraries. Since code evaluated by eval runs in a null
lexical environment, the resulting procedure can then be invoked with less
concern about possible side effects.
Use of these libraries does not provide any sort of safety guarantee. There
are still many loopholes uncaught, including attempts to process circular
structure and over-allocation of memory. The claim is only that the
probability of such an attack is reduced, not that it is eliminated. However,
using these libraries is a simple provision that is easy to implement and
easy to use. For higher safety, it can readily be combined with other
provisions.
* [378]171: Transducers, by Linus BjörnstamFinal: 2019-10-26Keywords: [379]Data
Structure
A library implementing transducers -- composable algorithmic transformations.
Scheme has many different ways of expressing transformations over different
collection types, but they are all unique to whatever base type they work on.
This SRFI proposes a new construct, the transducer, that is oblivious to the
context in which it is being used.
* [380]170: POSIX API, by Olin Shivers (original author), John Cowan (editor
and shepherd), and Harold Ancell (implementer and editor)Based on scsh by
Olin Shivers.Final: 2020-10-28Keywords: [381]Operating SystemSee also
[382]SRFI 198: Foreign Interface Status.
The host environment is the set of resources, such as the filesystem, network
and processes, that are managed by the operating system on top of which a
Scheme program is executing. This SRFI specifies some of the ways the host
environment can be accessed from within a Scheme program. It does so by
leveraging widespread support for POSIX, the Portable Operating System
Interface standardized by the IEEE. Not all of the functions of this SRFI are
available on all operating systems.
* [383]169: Underscores in numbers, by Lassi KortelaFinal: 2019-07-26Keywords:
[384]Numbers, [385]Reader Syntax
Many people find that large numbers are easier to read when the digits are
broken into small groups. For example, the number 1582439 might be easier to
read if written as 1 582 439. This applies to source code as it does to other
writing. We propose an extension of Scheme syntax to allow the underscore as
a digit separator in numerical constants.
* [386]168: Generic Tuple Store Database, by Amirouche BoubekkiFinal:
2019-11-08Keywords: [387]I/OSee also [388]SRFI 167: Ordered Key Value Store
and [389]SRFI 173: Hooks.
This library is a generic approach to the database abstractions known as
triplestore and quadstore. Generic Tuple Store Database implements n-tuple
ordered sets and associated primitives for working with them in the context
of data management.
* [390]167: Ordered Key Value Store, by Amirouche BoubekkiFinal:
2019-11-08Keywords: [391]I/OSee also [392]SRFI 168: Generic Tuple Store
Database and [393]SRFI 173: Hooks.
This library describes an interface for an ordered key-value store that is
suitable for implementing a storage engine for the generic tuple-store SRFI.
It maps cleanly to existing ordered key-value databases that may or may not
provide transactions.
* [394]166: Monadic Formatting, by Alex ShinnFinal: 2020-07-30Keywords:
[395]I/OSee also [396]SRFI 13: String Libraries, [397]SRFI 159: Combinator
Formatting, and [398]SRFI 165: The Environment Monad.
A library of procedures for formatting Scheme objects to text in various
ways, and for easily concatenating, composing and extending these formatters
efficiently without resorting to capturing and manipulating intermediate
strings.
This SRFI is an updated version of SRFI 159, primarily with the difference
that state variables are hygienic.
Summary of differences from SRFI 159:
+ State variables are first class and hygienic
+ Added written-shared, pretty-shared
+ Added as-italic, as-color, as-true-color, on-color background variants,
and pretty-with-color
+ Added ambiguous-is-wide? state variable and string-terminal-width/wide
utility
+ Added substring/width state var for width-aware substring operations,
with substring-terminal-width(/wide) utilities
+ Added substring/preserve state var used in trimming, with
substring-terminal-preserve utility
+ Added pretty-environment state variable
+ Renamed as-unicode to terminal-aware
+ Restored non-uniform comma rules as needed in India
+ Restored upcased and downcased
+ Several clarifications and more examples
* [399]165: The Environment Monad, by Marc Nieper-WißkirchenFinal:
2019-09-05Keywords: [400]MiscellaneousSee also [401]SRFI 159: Combinator
Formatting and [402]SRFI 166: Monadic Formatting.
Monads model computations. The environment monad models computations that
depend on values from a shared environment. These computations can read
values from the environment, pass values to subsequent computations, execute
sub-computations in an extended environment, and modify the environment for
future computations.
* [403]164: Enhanced multi-dimensional Arrays, by Per BothnerFinal:
2019-08-08Keywords: [404]Data StructureSee also [405]SRFI 4: Homogeneous
numeric vector datatypes, [406]SRFI 25: Multi-dimensional Array Primitives,
[407]SRFI 122: Nonempty Intervals and Generalized Arrays, and [408]SRFI 163:
Enhanced array literals.
This SRFI describes the array data type (a generalization of vectors to
multiple indexes or dimensions), along with a set of procedures for working
on them.
This specification is an extension of [409]SRFI 25, with additions from
Racket's [410]math.array package and other sources. It has been implemented
in the [411]Kawa dialect of Scheme.
* [412]163: Enhanced array literals, by Per BothnerFinal: 2019-01-18Keywords:
[413]Reader SyntaxSee also [414]SRFI 4: Homogeneous numeric vector datatypes,
[415]SRFI 25: Multi-dimensional Array Primitives, [416]SRFI 48: Intermediate
Format Strings, [417]SRFI 58: Array Notation, [418]SRFI 58: Array Notation,
[419]SRFI 122: Nonempty Intervals and Generalized Arrays, [420]SRFI 160:
Homogeneous numeric vector libraries, and [421]SRFI 164: Enhanced
multi-dimensional Arrays.
This is a specification of a reader form (literals) for multi-dimensional
arrays. It is an extension of the Common Lisp array reader syntax to handle
non-zero lower bounds, optional explicit bounds, and optional uniform element
types (compatible with [422]SRFI 4). It can be used in conjunction with
[423]SRFI 25, [424]SRFI 122, or [425]SRFI 164. These extensions were
implemented in Guile (except the handling of rank-0 arrays), and later in
Kawa.
There are recommendations for output formatting and a suggested format-array
procedure.
* [426]162: Comparators sublibrary, by John CowanFinal: 2019-08-27Keywords:
[427]ComparisonSee also [428]SRFI 114: Comparators and [429]SRFI 128:
Comparators (reduced).
This SRFI provides a few extra procedures and comparators to go with SRFI
128, Comparators. Implementers are urged to add them to their SRFI 128
libraries, for which reason they are not packaged as a separate library.
* [430]161: Unifiable Boxes, by Marc Nieper-WißkirchenFinal:
2019-02-08Keywords: [431]Data StructureSee also [432]SRFI 111: Boxes.
Unifiable boxes are, like the boxes of [433]SRFI 111, objects with a single
mutable state. A constructor, predicate, accessor, and mutator are provided.
In addition to this, an equality predicate and union operations (link, union,
unify) are provided. Applying a union operation to two unifiable boxes makes
the two boxes equal (in the sense of the equality predicate). As a
consequence, their state will also become identical. In the case of link and
union, it will be the state of one of the two unioned boxes. In the case of
unify, the state is determined by a supplied unification procedure.
Unifiable boxes are also known under the names disjoint-set data structure,
union-find data structure or merge-find set.
* [434]160: Homogeneous numeric vector libraries, by John Cowan and Shiro Kawai
(contributed a major patch)Based on SRFI 4 by Marc Feeley.Final:
2019-08-27Keywords: [435]Data Structure, [436]R7RS Large, [437]R7RS Large:
Tangerine EditionSee also [438]SRFI 4: Homogeneous numeric vector datatypes,
[439]SRFI 74: Octet-Addressed Binary Blocks, [440]SRFI 133: Vector Library
(R7RS-compatible), and [441]SRFI 152: String Library (reduced).
This SRFI describes a set of operations on SRFI 4 homogeneous vector types
(plus a few additional types) that are closely analogous to the vector
operations library, [442]SRFI 133. An external representation is specified
which may be supported by the read and write procedures and by the program
parser so that programs can contain references to literal homogeneous
vectors.
* [443]159: Combinator Formatting, by Alex ShinnWithdrawn: 2020-07-31Keywords:
[444]I/O, [445]R7RS Large, [446]R7RS Large: Tangerine Edition,
[447]SupersededSee also [448]SRFI 28: Basic Format Strings, [449]SRFI 48:
Intermediate Format Strings, and [450]SRFI 166: Monadic Formatting.
A library of procedures for formatting Scheme objects to text in various
ways, and for easily concatenating, composing and extending these formatters
efficiently without resorting to capturing and manipulating intermediate
strings.
* [451]158: Generators and Accumulators, by Shiro Kawai, John Cowan, and Thomas
GilrayFinal: 2017-10-27Keywords: [452]Data Structure, [453]R7RS Large,
[454]R7RS Large: Tangerine EditionLibrary name:
generators-and-accumulatorsSee also [455]SRFI 121: Generators.
This SRFI defines utility procedures that create, transform, and consume
generators. A generator is simply a procedure with no arguments that works as
a source of values. Every time it is called, it yields a value. Generators
may be finite or infinite; a finite generator returns an end-of-file object
to indicate that it is exhausted. For example, read-char, read-line, and read
are generators that generate characters, lines, and objects from the current
input port. Generators provide lightweight laziness.
This SRFI also defines procedures that return accumulators. An accumulator is
the inverse of a generator: it is a procedure of one argument that works as a
sink of values.
* [456]157: Continuation marks, by Marc Nieper-WißkirchenWithdrawn:
2023-06-29Keywords: [457]Continuations
Continuation marks are a programming language feature that allows one to
attach information to and retrieve information from continuations,
generalizing stack inspection. Conceptually, a continuation consists of a
number of frames where each frame stands for an active procedure call that is
not a tail call. A continuation mark is then a key-value pair associated with
a frame, with keys compared using eq?. At most one mark for a given key can
be attached to a single frame.
Besides stack inspection, continuation marks can be used to implement dynamic
scope, delimited continuations, or delayed evaluation that is able to handle
iterative lazy algorithms.
This SRFI proposes to add continuation marks to the Scheme programming
language. The interface defined here is modelled after Racket's continuation
marks. It does not include all forms and procedures provided by Racket but
provides a compatible subset.
* [458]156: Syntactic combiners for binary predicates, by Panicz Maciej
GodekFinal: 2017-12-18Keywords: [459]SyntaxLibrary name:
predicate-combinersSee also [460]SRFI 26: Notation for Specializing
Parameters without Currying.
Recognizing binary predicates as a specific area in which the use of prefix
operators is an impediment, we propose a thin layer of "syntactic stevia" for
in-fixing such predicates. It can be implemented using regular Scheme macros.
We suggest that the code (is x < y) should be transformed to (< x y), and (is
x < y string, and any attempt to do so "should raise an exception" (R6RS),
all other strings are mutable.
Although many mutable strings are never actually mutated, the mere
possibility of mutation complicates specifications of libraries that use
strings, encourages precautionary copying of strings, and precludes structure
sharing that could otherwise be used to make procedures such as substring and
string-append faster and more space-efficient.
This SRFI specifies a new data type of immutable texts. It comes with
efficient and portable sample implementations that guarantee O(1) indexing
for both sequential and random access, even in systems whose string-ref
procedure takes linear time.
The operations of this new data type include analogues for all of the
non-mutating operations on strings specified by the R7RS and most of those
specified by [560]SRFI 130, but the immutability of texts and uniformity of
character-based indexing simplify the specification of those operations while
avoiding several inefficiencies associated with the mutability of Scheme's
strings.
* [561]134: Immutable Deques, by Kevin Wortman, John Cowan, and Wolfgang
Corcoran-MatheFinal: 2016-07-01Keywords: [562]Data Structure, [563]R7RS
Large, [564]R7RS Large: Red Edition
This SRFI defines immutable deques. A deque is a double-ended queue, a
sequence which allows elements to be added or removed efficiently from either
end. A structure is immutable when all its operations leave the structure
unchanged. Note that none of the procedures specified here ends with an
exclamation point.
* [565]133: Vector Library (R7RS-compatible), by John CowanBased on SRFI 43 by
Taylor Campbell.Final: 2016-03-20Keywords: [566]Data Structure, [567]R7RS
Large, [568]R7RS Large: Red EditionLibrary name: vectorsSee also [569]SRFI
43: Vector library and [570]SRFI 160: Homogeneous numeric vector libraries.
This SRFI proposes a comprehensive library of vector operations accompanied
by a freely available and complete reference implementation. The reference
implementation is unencumbered by copyright, and useable with no
modifications on any Scheme system that is R5RS-compliant. It also provides
several hooks for implementation-specific optimization as well.
* [571]132: Sort Libraries, by John CowanBased on SRFI 32 by Olin
Shivers.Final: 2016-04-20Keywords: [572]Algorithm, [573]R7RS Large, [574]R7RS
Large: Red EditionLibrary name: sortingSee also [575]SRFI 32: Sort Libraries.
This SRFI describes the API for a full-featured sort toolkit.
* [576]131: ERR5RS Record Syntax (reduced), by John Cowan and Will
ClingerFinal: 2016-02-13Keywords: [577]Data StructureLibrary name: recordsSee
also [578]SRFI 150: Hygienic ERR5RS Record Syntax (reduced).
This SRFI is a reduced version of the SRFI 99 syntactic layer that can be
implemented with syntax-rules without requiring low-level macros. Like
SRFI-99's syntax layer, it is backward compatible with the define-record-type
macro from [579]SRFI 9 or R7RS-small. It is forward compatible with [580]SRFI
99.
* [581]130: Cursor-based string library, by John CowanFinal:
2016-05-28Keywords: [582]Data StructureLibrary name: string-cursorsSee also
[583]SRFI 13: String Libraries.
R5RS Scheme has an impoverished set of string-processing utilities, which is
a problem for authors of portable code. Although R7RS provides some
extensions and improvements, it is still very incomplete. This SRFI proposes
a coherent and comprehensive set of string-processing procedures; it is
accompanied by a portable sample implementation of the spec.
This SRFI is derived from SRFI 13. The biggest difference is that it allows
subsequences of strings to be specified by cursors as well as the traditional
string indexes. In addition, it omits the comparison, case-mapping, and
mutation operations of SRFI 13, as well as all procedures already present in
R7RS.
* [584]129: Titlecase procedures, by John CowanFinal: 2016-03-08Keywords:
[585]InternationalizationLibrary name: titlecase
This SRFI defines R7RS-style char-title-case?, char-titlecase, and
string-titlecase procedures.
* [586]128: Comparators (reduced), by John CowanFinal: 2016-02-14Keywords:
[587]ComparisonLibrary name: comparatorsSee also [588]SRFI 114: Comparators
and [589]SRFI 162: Comparators sublibrary.
This SRFI provides comparators, which bundle a type test predicate, an
equality predicate, an ordering predicate, and a hash function (the last two
are optional) into a single Scheme object. By packaging these procedures
together, they can be treated as a single item for use in the implementation
of data structures.
* [590]127: Lazy Sequences, by John CowanFinal: 2016-01-18Keywords: [591]Data
Structure, [592]R7RS Large, [593]R7RS Large: Red EditionLibrary name:
lazy-sequences
Lazy sequences (or lseqs, pronounced "ell-seeks") are a generalization of
lists. In particular, an lseq is either a proper list or a dotted list whose
last cdr is a [594]SRFI 121 generator. A generator is a procedure that can be
invoked with no arguments in order to lazily supply additional elements of
the lseq. When a generator has no more elements to return, it returns an
end-of-file object. Consequently, lazy sequences cannot reliably contain
end-of-file objects.
This SRFI provides a set of procedures suitable for operating on lazy
sequences based on [595]SRFI 1.
* [596]126: R6RS-based hashtables, by Taylan Ulrich Bayirli/KammerFinal:
2016-02-01Keywords: [597]Data StructureLibrary name: r6rs-hashtablesSee also
[598]SRFI 69: Basic hash tables and [599]SRFI 125: Intermediate hash tables.
We provide a hashtable API that takes the R6RS hashtables API as a basis and
makes backwards compatible additions such as support for weak hashtables,
external representation, API support for double hashing implementations, and
utility procedures.
* [600]125: Intermediate hash tables, by John Cowan and Will ClingerFinal:
2016-05-28Keywords: [601]Data Structure, [602]R7RS Large, [603]R7RS Large:
Red EditionLibrary name: hashtablesSee also [604]SRFI 69: Basic hash tables
and [605]SRFI 126: R6RS-based hashtables.
This SRFI defines an interface to hash tables, which are widely recognized as
a fundamental data structure for a wide variety of applications. A hash table
is a data structure that:
+ Is disjoint from all other types.
+ Provides a mapping from objects known as keys to corresponding objects
known as values.
o Keys may be any Scheme objects in some kinds of hash tables, but
are restricted in other kinds.
o Values may be any Scheme objects.
+ Has no intrinsic order for the key-value associations it contains.
+ Provides an equality predicate which defines when a proposed key is the
same as an existing key. No table may contain more than one value for a
given key.
+ Provides a hash function which maps a candidate key into a non-negative
exact integer.
+ Supports mutation as the primary means of setting the contents of a
table.
+ Provides key lookup and destructive update in (expected) amortized
constant time, provided a satisfactory hash function is available.
+ Does not guarantee that whole-table operations work in the presence of
concurrent mutation of the whole hash table (values may be safely
mutated).
* [606]124: Ephemerons, by John CowanFinal: 2015-11-06Keywords: [607]Data
Structure, [608]R7RS Large, [609]R7RS Large: Red Edition
An ephemeron is an object with two components called its key and its datum.
It differs from an ordinary pair as follows: if the garbage collector (GC)
can prove that there are no references to the key except from the ephemeron
itself and possibly from the datum, then it is free to break the ephemeron,
dropping its reference to both key and datum. In other words, an ephemeron
can be broken when nobody else cares about its key. Ephemerons can be used to
construct weak vectors or lists and (possibly in combination with finalizers)
weak hash tables.
Much of this specification is derived with thanks from the MIT Scheme
Reference Manual.
* [610]123: Generic accessor and modifier operators, by Taylan Ulrich
Bayirli/KammerFinal: 2015-10-14Keywords: [611]Miscellaneous
Lisp dialects including Scheme have traditionally lacked short, simple,
generic syntax for accessing and modifying the fields of arbitrary
"collection" objects. We fill this gap for Scheme by defining generalized
accessors, and an associated SRFI-17 setter.
* [612]122: Nonempty Intervals and Generalized Arrays, by Bradley J.
LucierWithdrawn: 2022-09-25Keywords: [613]Data Structure, [614]Numbers,
[615]SupersededSee also [616]SRFI 164: Enhanced multi-dimensional Arrays,
[617]SRFI 179: Nonempty Intervals and Generalized Arrays (Updated), and
[618]SRFI 231: Intervals and Generalized Arrays.
This SRFI specifies an array mechanism for Scheme. Arrays as defined here are
quite general; at their most basic, an array is simply a mapping, or
function, from multi-indices of exact integers $i_0,\ldots,i_{d-1}$ to Scheme
values. The set of multi-indices $i_0,\ldots,i_{d-1}$ that are valid for a
given array form the domain of the array. In this SRFI, each array's domain
consists of a rectangular interval
$[l_0,u_0)\times[l_1,u_1)\times\cdots\times[l_{d-1},u_{d-1})$, a subset of
$\mathbb Z^d$, $d$-tuples of integers. Thus, we introduce a data type called
intervals, which encapsulate the cross product of nonempty intervals of exact
integers. Specialized variants of arrays are specified to provide portable
programs with efficient representations for common use cases.
* [619]121: Generators, by Shiro Kawai, John Cowan, and Thomas GilrayWithdrawn:
2019-07-18Keywords: [620]Data Structure, [621]R7RS Large: Red Edition,
[622]SupersededSee also [623]SRFI 158: Generators and Accumulators.
This SRFI defines utility procedures that create, transform, and consume
generators. A generator is simply a procedure with no arguments that works as
a source of a series of values. Every time it is called, it yields a value.
Generators may be finite or infinite; a finite generator returns an
end-of-file object to indicate that it is exhausted. For example, read-char,
read-line, and read are generators that generate characters, lines, and
objects from the current input port. Generators provide lightweight laziness.
* [624]120: Timer APIs, by Takashi KatoFinal: 2015-08-06Keywords:
[625]Miscellaneous
This SRFI defines interfaces to handle timer processes.
* [626]119: wisp: simpler indentation-sensitive scheme, by Arne
BabenhauserheideFinal: 2015-06-23Keywords: [627]Reader Syntax
This SRFI describes a simple syntax which allows making scheme easier to read
for newcomers while keeping the simplicity, generality and elegance of
s-expressions. Similar to [628]SRFI 110, [629]SRFI 49 and Python it uses
indentation to group expressions. Like [630]SRFI 110 wisp is general and
homoiconic.
Different from its predecessors, wisp only uses the absolute minimum of
additional syntax-elements which are required for writing and exchanging
arbitrary code-structures. As syntax elements it only uses a colon surrounded
by whitespace, the period followed by whitespace as first code-character on
the line and optional underscores followed by whitespace at the beginning of
the line.
It resolves a limitation of [631]SRFI 110 and [632]SRFI 49, both of which
force the programmer to use a single argument per line if the arguments to a
procedure need to be continued after a procedure-call.
Wisp expressions can include arbitrary s-expressions and as such provide
backwards compatibility.
wisp s-exp
define : factorial n __ if : zero? n ____ . 1 ____ * n : factorial (- n 1) display
: factorial 5 newline
(define (factorial n) (if (zero? n) 1 (* n (factorial (- n 1))))) (dis
play (factorial 5)) (newline)
* [633]118: Simple adjustable-size strings, by Per BothnerFinal:
2015-07-07Keywords: [634]Data StructureSee also [635]SRFI 135: Immutable
Texts and [636]SRFI 140: Immutable Strings.
Scheme specifies mutable fixed-length strings. We add two procedures
string-append! and string-replace! which allow the size of the string to
change. We also require that the standard Scheme procedures make-string and
string-copy return variable-size strings.
* [637]117: Queues based on lists, by John CowanFinal: 2015-08-25Keywords:
[638]Data Structure, [639]R7RS Large, [640]R7RS Large: Red EditionLibrary
name: list-queues
List queues are mutable ordered collections that can contain any Scheme
object. Each list queue is based on an ordinary Scheme list containing the
elements of the list queue by maintaining pointers to the first and last
pairs of the list. It's cheap to add or remove elements from the front of the
list or to add elements to the back, but not to remove elements from the
back. List queues are disjoint from other types of Scheme objects.
* [641]116: Immutable List Library, by John CowanFinal: 2014-11-28Keywords:
[642]Data Structure, [643]R7RS Large, [644]R7RS Large: Red Edition
Scheme currently does not provide immutable pairs corresponding to its
existing mutable pairs, although most uses of pairs do not exploit their
mutability. The [645]Racket system takes the radical approach of making
Scheme's pairs immutable, and providing a minimal library of mutable pairs
with procedures named mpair?, mcons, mcar, mcdr, set-mcar!, set-mcdr!. This
SRFI takes the opposite approach of leaving Scheme's pairs unchanged and
providing a full set of routines for creating and dealing with immutable
pairs. The sample implementation is portable (to systems with SRFI 9) and
efficient.
* [646]115: Scheme Regular Expressions, by Alex ShinnFinal: 2014-07-14Keywords:
[647]Data Structure, [648]R7RS Large, [649]R7RS Large: Tangerine
EditionLibrary name: regex
This SRFI provides a library for matching strings with regular expressions
described using the SRE "Scheme Regular Expression" notation first introduced
by SCSH, and extended heavily by IrRegex.
* [650]114: Comparators, by John CowanWithdrawn: 2017-08-10Keywords:
[651]Comparison, [652]SupersededSee also [653]SRFI 128: Comparators
(reduced).
This proposal is a rewrite of [654]SRFI 67, Compare Procedures, extending it
from procedures that represent a total order to procedure bundles that
represent one or more of a total order, an equality predicate, and a hash
function. By packaging these procedures together, along with a type test
predicate, they can be treated as a single item for use in the implementation
of data structures.
* [655]113: Sets and bags, by John CowanFinal: 2014-11-28Keywords: [656]Data
Structure, [657]R7RS Large, [658]R7RS Large: Red EditionSee also [659]SRFI
217: Integer Sets.
Sets and bags (also known as multisets) are unordered collections that can
contain any Scheme object. Sets enforce the constraint that no two elements
can be the same in the sense of the set's associated equality predicate; bags
do not.
* [660]112: Environment Inquiry, by John CowanFinal: 2013-09-12Keywords:
[661]Operating System
This is a proposal for environment inquiry, providing human-readable
information at run time about the hardware and software configuration on
which a Scheme program is being executed. They are mostly based on Common
Lisp, with additions from the Posix uname() system call.
* [662]111: Boxes, by John CowanFinal: 2013-07-03Keywords: [663]Data Structure,
[664]R7RS Large, [665]R7RS Large: Red EditionSee also [666]SRFI 195:
Multiple-value boxes.
Boxes are objects with a single mutable state. Several Schemes have them,
sometimes called cells. A constructor, predicate, accessor, and mutator are
provided.
* [667]110: Sweet-expressions (t-expressions), by David A. Wheeler and Alan
Manuel K. GloriaFinal: 2013-09-09Keywords: [668]Reader Syntax
This SRFI describes a set of syntax extensions for Scheme, called
sweet-expressions (t-expressions), that has the same descriptive power as
s-expressions but is designed to be easier for humans to read. The
sweet-expression syntax enables the use of syntactically-meaningful
indentation to group expressions (similar to Python), and it builds on the
infix and traditional function notation defined in [669]SRFI-105
(curly-infix-expressions). Unlike nearly all past efforts to improve
s-expression readability, sweet-expressions are general (the notation is
independent from any underlying semantic) and homoiconic (the underlying data
structure is clear from the syntax). This notation was developed by the
"[670]Readable Lisp S-expressions Project" and can be used for both programs
and data.
Sweet-expressions can be considered a set of additional abbreviations, just
as 'x already abbreviates (quote x). Sweet-expressions and traditionally
formatted s-expressions can be freely mixed; this provides backwards
compatibility, simplifies transition, and enables developers to maximize
readability. Here is an example of a sweet-expression and its equivalent
s-expression (note that a sweet-expression reader would accept either
format):
sweet-expression s-expression
define fibfast(n) ; Typical function notation if {n < 2} ; Indentation, infix
{...} n ; Single expr = no new list fibup n 2 1 0 ; Simple functio
n calls
(define (fibfast n) (if (< n 2) n (fibup n 2 1 0)))
* [671]109: Extended string quasi-literals, by Per BothnerFinal:
2013-06-21Keywords: [672]Reader SyntaxSee also [673]SRFI 107: XML reader
syntax and [674]SRFI 108: Named quasi-literal constructors.
This specifies a reader extension for extended string quasi-literals,
including nicer multi-line strings, and enclosed unquoted expressions.
This proposal is related to [675]SRFI-108 (named quasi-literal constructors)
and [676]SRFI-107 (XML reader syntax), as they share quite a bit of syntax.
* [677]108: Named quasi-literal constructors, by Per BothnerFinal:
2013-06-21Keywords: [678]Reader Syntax
This specifies an extensible reader syntax for named value constructors. A
reader prefix is followed by a "tag" (an identifier), and then expressions
and literal text parameters. The tag can be though of as a class name, and
the expression and literal text are arguments to an object constructor call.
The reader translates &tag{...} to a list ($construct$:tag ...), where
$construct$:tag is normally bound to a predefined macro.
This propsal depends on [679]SRFI-109 (extended string quasi-literals) (in
spite of having a lower number). It also shares quite of bit of syntax with
[680]SRFI-107 (XML reader syntax).
* [681]107: XML reader syntax, by Per BothnerFinal: 2013-12-22Keywords:
[682]Reader Syntax
We specify a reader extension that reads data in a superset of XML/HTML
format, and produces conventional S-expressions. We also suggest a possible
semantics interpretation of how these forms may be evaluated to produce
XML-node values, but this is non-normative.
* [683]106: Basic socket interface, by Takashi KatoFinal: 2013-08-20Keywords:
[684]I/O
This document specifies basic socket interfaces.
* [685]105: Curly-infix-expressions, by David A. Wheeler and Alan Manuel K.
GloriaFinal: 2012-11-06Keywords: [686]Reader Syntax
Lisp-based languages, like Scheme, are almost the only programming languages
in modern use that do not support infix notation. In addition, most languages
allow infix expressions to be combined with function call notation of the
form f(x). This SRFI provides these capabilities, both for developers who
already use Scheme and want these conveniences, and also for other developers
who may choose to use other languages in part because they miss these
conveniences. Scheme currently reserves {...} "for possible future extensions
to the language". We propose that {...} be used to support
"curly-infix-expression" notation as a homoiconic infix abbreviation, as a
modification of the Scheme reader. It is an abbreviation in much the same way
that 'x is an abbreviation for (quote x).
A curly-infix list introduces a list whose visual presentation can be in
infix order instead of prefix order. For example, {n > 5} => (> n 5), and
{a + b + c} => (+ a b c). By intent, there is no precedence, but e.g.,
{x + {y * z}} maps cleanly to (+ x (* y z)). Forms with mixed infix operators
and other complications have "$nfx$" prepended to enable later processing,
e.g., {4 + 5 * 6} => ($nfx$ 4 + 5 * 6). Also, inside a curly-infix list
(recursively), expressions of the form f(...) are simply an abbreviation for
(f ...).
Note that this is derived from the "[687]readable" project. We intend to
later submit at least one additional SRFI that will build on top of this
SRFI, but curly-infix-expressions are useful on their own.
* [688]104: Library Files Utilities, by Derick EddingtonWithdrawn:
2010-05-23Keywords: [689]Operating System
This SRFI implements [690]SRFI 103: Library Files as a library. It is useful
for working with library files.
* [691]103: Library Files, by Derick EddingtonWithdrawn: 2013-05-08Keywords:
[692]Operating System
This SRFI defines a standard for locating files containing libraries with
list-of-symbols library names, for unixes and Windows. It defines a standard
for files containing R6RS libraries. It supports different Scheme dialects.
* [693]102: Procedure Arity Inspection, by David Van HornWithdrawn:
2013-02-24Keywords: [694]Introspection
Many Scheme systems provide mechanisms for inspecting the arity of a
procedural value, making it a common feature, however there is no standard
interface. As a result there is no portable way to observe the arity of a
procedure without actually applying it. This SRFI proposes a simple interface
that is consistent with existing Scheme systems' facilities and prior
proposals.
* [695]101: Purely Functional Random-Access Pairs and Lists, by David Van
HornFinal: 2013-02-24Keywords: [696]Data Structure, [697]R7RS Large,
[698]R7RS Large: Red Edition
Random-access lists [1] are a purely functional data structure for
representing lists of values. A random-access list may act as a drop in
replacement for the usual linear-access pair and list data structures (pair?,
cons, car, cdr), which additionally supports fast index-based addressing and
updating (list-ref, list-set). The impact is a whole class of
purely-functional algorithms expressed in terms of index-based list
addressing become feasible compared with their linear-access list
counterparts.
This document proposes a library API for purely functional random-access
lists consistent with the R^6RS [2] base library and list utility standard
library [3].
* [699]100: define-lambda-object, by Joo ChurlSooFinal: 2010-06-21Keywords:
[700]Data Structure
This SRFI introduces a macro, DEFINE-LAMBDA-OBJECT which defines a set of
procedures, that is, a group, two constructors, and a predicate. The
constructors also make a group of procedures, namely lambda objects. The
macro extends DEFINE-RECORD-TYPE (SRFI 9) in being more general but much less
general than DEFCLASS (CLOS). The macro has no explicit field accessors and
mutators but parent groups, required fields, optional fields, automatic
fields, read-write fields, read-only fields, inaccessible hidden fields,
immutable virtual fields, and common sharing fields.
* [701]99: ERR5RS Records, by William D ClingerFinal: 2009-10-07Keywords:
[702]Data StructureLibrary name: recordsSee also [703]SRFI 237: R6RS Records
(refined).
Many Scheme programmers have considered records to be one of the most
important features missing from the R5RS. The R6RS proposed a record system,
but its design has been widely criticized and it was not intended for use in
R5RS programs anyway.
This SRFI proposes a better record system for use in R5RS, ERR5RS, and R6RS
programs. The syntactic layer of this SRFI's record system is an extension of
SRFI 9. The procedural and inspection layers of this SRFI's record system are
perfectly compatible with its syntactic layer. This entire SRFI is compatible
with the procedural and inspection layers of the R6RS record system, but
offers several worthwhile improvements over the R6RS system.
* [704]98: An interface to access environment variables, by Taro Minowa
(Higepon)Final: 2008-09-19Keywords: [705]Operating SystemLibrary name:
os-environment-variables
This SRFI specifies the procedure get-environment-variable, which gets the
value of the specified environment variable, and the procedure
get-environment-variables, which gets an association list of all environment
variables.
* [706]97: SRFI Libraries, by David Van HornFinal: 2008-12-22Keywords:
[707]Modules
Over the past ten years, numerous libraries have been specified via the
Scheme Requests for Implementation process. Yet until the recent ratification
of the Revised^6 Report on the Algorithmic Language Scheme, there has been no
standardized way of distributing or relying upon library code. Now that such
a library system exists, there is a real need to organize these existing SRFI
libraries so that they can be portably referenced.
This SRFI is designed to facilitate the writing and distribution of code that
relies on SRFI libraries. It identifies a subset of existing SRFIs that
specify features amenable to provision (and possibly implementation) as
libraries (SRFI Libraries) and proposes a naming convention for this subset
so that these libraries may be referred to by name or by number.
* [708]96: SLIB Prerequisites, by Aubrey JafferFinal: 2008-07-07Keywords:
[709]Features
This SRFI specifies a set of procedures and macros presenting a uniform
interface sufficient to host the [710]SLIB Scheme Library system.
* [711]95: Sorting and Merging, by Aubrey JafferFinal: 2007-01-29Keywords:
[712]AlgorithmLibrary name: sorting-and-merging
Sorting and Merging are useful operations deserving a common API.
* [713]94: Type-Restricted Numerical Functions, by Aubrey JafferFinal:
2007-01-30Keywords: [714]Numbers
In the coding of numerial calculations in latent-typed languages it is good
practice to assure that those calculations are using the intended number
system. The most common number systems for programmatic calculations are the
integers, reals, and complexes. This SRFI introduces 14 real-only and 3
integer-only variants of R5RS procedures to facilitate numerical type
checking and declaration.
* [715]93: R6RS Syntax-Case Macros, by Kent DybvigWithdrawn:
2006-08-23Keywords: [716]Syntax, [717]R6RS processSee also [718]SRFI 188:
Splicing binding constructs for syntactic keywords and [719]SRFI 211: Scheme
Macro Libraries.
The syntactic abstraction system described here extends the R5RS macro system
with support for writing low-level macros in a high-level style, with
automatic syntax checking, input destructuring, output restructuring,
maintenance of lexical scoping and referential transparency (hygiene), and
support for controlled identifier capture, with constant expansion overhead.
Because it does not require literals, including quoted lists or vectors, to
be copied or even traversed, it preserves sharing and cycles within and among
the constants of a program. It also supports source-object correlation, i.e.,
the maintenance of ties between the original source code and expanded output,
allowing implementations to provide source-level support for debuggers and
other tools.
* [720]92: ALAMBDA and ALAMBDA*, by Joo ChurlSooWithdrawn: 2007-04-09Keywords:
[721]Miscellaneous, [722]Type Checking
This SRFI introduces ALAMBDA and ALAMBDA*, each of which has two modes of
operation:
1. it creates a procedure that checks actual arguments and takes optional
arguments,
2. it returns a different procedure by checking each of actual arguments
and the number of them.
* [723]91: Extended ports, by Marc FeeleyWithdrawn: 2007-07-10Keywords:
[724]I/O
This SRFI specifies an extension to the R5RS ports that supports several
useful features: binary I/O and text I/O, bulk I/O, file opening attributes,
and bidirectional ports. Binary I/O is provided through byte ports which are
ports whose fundamental I/O unit is an 8 bit byte. Because characters can be
encoded with bytes using a character encoding such as ISO 8859-1, UTF-8, and
UTF-16BE, any byte port is also a character port (a port that supports the
character level I/O of R5RS). A byte port's character encoding and various
other attributes are specified when the port is opened. Because reasonable
defaults exist, these attributes are specified using a named optional
parameter syntax. All procedures which have the same name as in R5RS are
compatible with R5RS but may provide additional functionality.
* [725]90: Extensible hash table constructor, by Marc FeeleyFinal:
2007-07-10Keywords: [726]Data Structure
This SRFI specifies the procedure make-table, a hash table constructor
compatible with [727]SRFI 69 (Basic hash tables). The procedure make-table
allows various parameters of the hash table to be specified with optional
named parameters when it is constructed. These parameters are: the initial
size, the minimum and maximum load factor, the key equivalence function, the
key hashing function, whether the references to the keys are weak, and
similarly for the values. By using optional named parameters, as specified in
[728]SRFI 89 (Optional positional and named parameters), the constructor's
API can be easily extended in a backward compatible way by other SRFIs and
Scheme implementations.
* [729]89: Optional positional and named parameters, by Marc FeeleyFinal:
2007-07-10Keywords: [730]BindingSee also [731]SRFI 88: Keyword objects and
[732]SRFI 177: Portable keyword arguments.
This SRFI specifies the define* and lambda* special forms. These forms extend
the R5RS define and lambda special forms to simplify the use of optional
positional and named parameters. Optional positional parameters, optional
named parameters and required named parameters are covered by this SRFI. The
formal parameter list syntax specified in this SRFI is different from the
syntax used by Common Lisp and the DSSSL languages but nevertheless offers
similar functionality and a nicer syntax. Formal parameter lists which
conform to the R5RS syntax have the same meaning as in R5RS.
* [733]88: Keyword objects, by Marc FeeleyFinal: 2007-07-03Keywords:
[734]Reader SyntaxSee also [735]SRFI 89: Optional positional and named
parameters and [736]SRFI 177: Portable keyword arguments.
This SRFI defines keyword objects, a data type similar to Scheme symbols.
Keyword objects have the same lexical syntax as symbols but they must end in
a colon. Moreover keyword objects are self-evaluating. Procedures for
converting between strings and keyword objects (string->keyword and
keyword->string) and a type predicate (keyword?) are defined. Finally this
SRFI specifies the changes to the Scheme lexical syntax required to
accomodate keywords.
* [737]87: => in case clauses, by Chongkai ZhuFinal: 2006-10-18Keywords:
[738]Control FlowLibrary name: case
This SRFI proposes an extension to the case syntax to allow the => clauses as
in cond.
* [739]86: MU and NU simulating VALUES & CALL-WITH-VALUES, and their related
LET-syntax, by Joo ChurlSooFinal: 2006-06-20Keywords: [740]Data Structure,
[741]Multiple-Value ReturnsLibrary name: mu-and-nu
Unlike the values/call-with-values mechanism of R5RS, this SRFI uses an
explicit representation for multiple return values as a single value, namely
a procedure. Decomposition of multiple values is done by simple application.
Each of the two macros, mu and nu, evaluates to a procedure that takes one
procedure argument. The mu and nu can be compared with lambda. While lambda
expression that consists of and requires some actual
arguments later when the evaluated lambda expression is called, mu and nu
expressions that consist of s corresponding to actual arguments
of lambda require and , that is, an evaluated lambda
expression, later when the evaluated mu and nu expressions are called.
This SRFI also introduces new let-syntax depending on mu and nu to manipulate
multiple values, alet and alet* that are compatible with let and let* of R5RS
in single value bindings. They also have a binding form making use of values
and call-with-values to handle multiple values. In addition, they have
several new binding forms for useful functions such as escape, recursion,
etc.
* [742]85: Recursive Equivalence Predicates, by William D ClingerWithdrawn:
2006-10-21Keywords: [743]Comparison
This SRFI defines two related equivalence predicates that are recursive, not
just partial recursive: they terminate on all arguments. One of these
predicates, equiv?, is consistent with the equal? procedure described in the
R5RS: Whenever equal? terminates, equiv? returns the same value as equal?.
* [744]84: Universal Identifiers, by Andrew WilcoxWithdrawn:
2006-11-09Keywords: [745]Data Structure
This SRFI proposes a social convention to allow programmers to easily create
short, simple Scheme symbols which are guaranteed to be universally unique:
No other programmer also following this SRFI will accidentally create a
symbol eq? to yours.
Universally unique symbols are useful to identify standards, languages,
libraries, types, classes, and other resources.
* [746]83: R6RS Library Syntax, by Matthew Flatt and Kent DybvigWithdrawn:
2006-09-13Keywords: [747]Modules, [748]R6RS process
The module system presented here is designed to let programmers share
libraries, i.e., code that is intended to be incorporated into larger
programs, and especially into programs that use library code from multiple
sources. The module system supports macro definitions within modules, allows
macro exports, and distinguishes the phases in which definitions and imports
are needed. This SRFI defines a standard notation for libraries, a semantics
for library expansion and execution, and a simple format for sharing
libraries.
* [749]82: Stream Ports, by Michael SperberWithdrawn: 2006-11-20Keywords:
[750]I/O
This SRFI augments [751]SRFI 81 (Port I/O) by allowing ports to be
constructed from streams as described in [752]SRFI 80 (Stream I/O).
* [753]81: Port I/O, by Michael SperberWithdrawn: 2006-11-20Keywords:
[754]I/OSee also [755]SRFI 80: Stream I/O and [756]SRFI 186: Transcoders and
transcoded ports.
This SRFI defines an I/O layer similar in nature to the ports subsystem in
R5RS, and provides conventional, imperative buffered input and output.
The layer architecture is similar to the upper three layers of the I/O
subsystem in [757]The Standard ML Basis Library.
In particular, the subsystem fulfills the following requirements:
+ buffered reading and writing
+ binary and text I/O, mixed if needed
+ the ability to create arbitrary I/O ports from readers and writers
It builds on the Primitive I/O layer specified in [758]SRFI 79 (Primitive
I/O).
* [759]80: Stream I/O, by Michael SperberWithdrawn: 2006-11-20Keywords:
[760]I/OSee also [761]SRFI 81: Port I/O and [762]SRFI 186: Transcoders and
transcoded ports.
This SRFI defines an I/O layer for lazy, mostly functional buffered streams.
The layer architecture is similar to the upper three layers of the I/O
subsystem in [763]The Standard ML Basis Library.
In particular, this layer provides
+ buffered reading and writing
+ arbitrary lookahead
+ dynamic redirection of input or output
+ binary and text I/O, mixed if needed
+ translated data streams
+ the ability to create I/O streams from arbitrary readers and writers
It builds on the Primitive I/O layer specified in [764]SRFI 79 (Primitive
I/O).
* [765]79: Primitive I/O, by Michael SperberWithdrawn: 2006-11-16Keywords:
[766]I/OSee also [767]SRFI 181: Custom ports (including transcoded ports).
This SRFI defines a simple, primitive I/O subsystem for Scheme that is
intended to function as the lowest layer of a more comprehensive suite of I/O
layers. It provides unbuffered I/O, and is close to what a typical operating
system offers. Thus, its interface is suitable for implementing
high-throughput and zero-copy I/O.
The Primitive I/O layer also allows clients to implement custom data sources
and sinks via a simple interface.
Moreover, this SRFI defines a condition hierarchy specifying common
I/O-related exceptional situations.
The Primitive I/O layer only handles blocking-I/O. Non-blocking and selective
I/O is left for another SRFI.
This I/O layer was designed in conjunction with two other layers that can be
built on top of it: [768]SRFI 80 (Stream I/O) and [769]SRFI 81 (Port I/O).
* [770]78: Lightweight testing, by Sebastian EgnerFinal: 2006-03-06Keywords:
[771]TestingLibrary name: lightweight-testing
A simple mechanism is defined for testing Scheme programs. As a most
primitive example, the expression
(check (+ 1 1) => 3)
evaluates the expression (+ 1 1) and compares the result with the expected
result 3 provided after the syntactic keyword =>. Then the outcome of this
comparison is reported in human-readable form by printing a message of the
form
(+ 1 1) => 2 ; *** failed *** ; expected result: 3
Moreover, the outcome of any executed check is recorded in a global state
counting the number of correct and failed checks and storing the first failed
check. At the end of a file, or at any other point, the user can print a
summary using check-report.
In addition to the simple test above, it is also possible to execute a
parametric sequence of checks. Syntactically, this takes the form of an eager
comprehension in the sense of [772]SRFI 42 [5]. For example,
(check-ec (:range e 100) (:let x (expt 2.0 e)) (= (+ x 1) x)
=> #f (e x))
This statement runs the variable e through {0..99} and for each binding
defines x as (expt 2.0 e). Then it is checked if (+ x 1) is equal to x, and
it is expected that this is not the case (i.e. expected value is #f). The
trailing (e x) tells the reporting mechanism to print the values of both e
and x in case of a failed check. The output could look like this:
(let ((e 53) (x 9007199254740992.0)) (= (+ x 1) x)) => #t ; *** failed *** ; expec
ted result: #f
The specification of bindings to report, (e x) in the example, is optional
but very informative. Other features of this SRFI are:
+ A way to specify a different equality predicate (default is equal?).
+ Controlling the amount of reporting being printed.
+ Switching off the execution and reporting of checks entriely.
+ Retrieving a boolean if all checks have been executed and passed.
* [773]77: Preliminary Proposal for R6RS Arithmetic, by William D Clinger and
Michael SperberWithdrawn: 2006-09-13Keywords: [774]R6RS process, [775]Numbers
Scheme's arithmetic system was designed to allow a wide variety of
implementations. After many years of implementation experience, however, most
implementations now fall into a small number of categories, and the benefits
of continued experimentation no longer justify the confusion and portability
problems that have resulted from giving implementations so much freedom in
this area. Moreover, the R5RS generic arithmetic is difficult to implement as
efficiently as purely fixnum or purely flonum arithmetic. (Fixnum arithmetic
is typically limited-precision integer arithmetic implemented using one or
more representations that may be especially efficient on the executing
machine; flonum arithmetic is typically limited-precision floating-point
arithmetic using one or more representations that may be especially efficient
on the executing machine.)
This SRFI is an effort to extend and clarify the R5RS arithmetic to make it
more portable, more comprehensive, and enable faster programs.
Furthermore, one of us (Sperber) has argued that Scheme's arithmetic requires
radical overhaul. The other (Clinger) agrees that revisions are needed.
Whether these revisions qualify as radical is best left to the judgement of
individual readers.
This SRFI proposes to revise section 6.2 ("Numbers") of R5RS by:
+ requiring a Scheme implementation to provide the full tower, including
exact rationals of arbitrary precision, exact rectangular complex
numbers with rational real and imaginary parts, and inexact real and
complex arithmetic
+ defining fixnum arithmetic (parameterized by precision)
+ defining flonum arithmetic (inexactly)
+ defining new procedures for performing exact arithmetic
+ defining new procedures for performing inexact arithmetic
+ describing the external representation and semantics of 0.0, -0.0,
infinities and NaNs for systems that implement inexact real arithmetic
using IEEE binary floating point
Usage: http://www.kk-software.de/kklynxview/get/URL
e.g. http://www.kk-software.de/kklynxview/get/http://www.kk-software.de
Errormessages are in German, sorry ;-)