[R6RS] Core/library strawman take 2

Anton van Straaten anton at appsolutions.com
Tue Apr 11 03:42:11 EDT 2006

Here's a summary of the updated core/library split proposal.  I can post 
a more detailed version later on Tuesday, but the below should provide a 
basis for further discussion in our meeting today.

For the new proposal, I'm temporarily putting aside the question of how 
the library system specifies its own version, and assuming that 
libraries must specify the language they depend on as an ordinary 
library import, e.g. "(import r6rs)" or "(import r6r6-core)".

As an overview, the names of the proposed libraries are as follows:

* r6rs-core
* syntax-rules
* syntax-case
* fixnum
* flonum
* primitive-i/o
* port-i/o
* multiple-values
* promises
* eval
* records-procedural
* records-explicit
* records-implicit (subsumes records-explicit)
* records-reflection
* hash-tables

In addition to the above, some composite libraries are defined, 
consisting of combinations of the above libraries:

* records - provides the combined functionality of the other four 
records libraries.
* r6rs-small
* r6rs
* r6rs-big

The contents of these libraries are summarized below.

Library: r6rs-core
After last week's meeting, I've consolidated a number of the smaller 
libraries into a single one, which includes the following items:

* All of the primitive expression types described in R5RS 4.1, including 
if, lambda, quote, set!
* 'define' - definitions as described in R5RS 5.2
* R5RS 4.2.1 Conditionals: cond, case, and, or
* R5RS 4.2.2 Binding constructs: let, let*, letrec, letrec*
* R5RS 4.2.3 Sequencing: begin
* R5RS 4.2.4 Iteration: do, named let
* R5RS 4.2.6 Quasiquotation: quasiquote, unquote, unquote-splicing
* R5RS 6.1 Equivalence predicates
* R5RS 6.2 Generic arithmetic procedures (excluding flonum- and 
fixnum-specific procedures)
* R5RS 6.3 Other data types: booleans, pairs and lists, symbols, chars, 
strings, vectors and related procedures.
* Procedures related to the new 'bytes' type.
* R5RS 6.4: procedure? apply map for-each call-with-current-continuation 
* Exception and conditions (SRFI 34 and 35)

This library includes features which some client libraries may wish to 
exclude.  The SRFI 83 "except" clause can be used for this purpose, e.g.

(library "hello" "scheme://r6rs"
   (import (except "r6rs" do named-let)

Library: syntax-rules
Provides define-syntax, let-syntax, letrec-syntax, and the syntax-rules 
macro system.

Library: syntax-case
Provides define-syntax, let-syntax, letrec-syntax, the syntax-case macro 
system, and syntax-rules.

Library: fixnum
Fixnum-specific procedures.

Library: flonum
Flonum-specific procedures.

Library: primitive-i/o

Library: port-i/o

Library: multiple-values
values, call-with-values, "let-values", etc.

Library: promises
delay, force -- we have decided that these are "definitely in a separate 
library".  Should they be combined into some other library outside the core?

Library: eval
load, eval, scheme-report-environment, null-environment, 

Library: records
The record system will be split into four separate libraries.  This 
'records' library provides the combined functionality of all four libraries.

Library: records-procedural
SRFI 76 procedural layer

Library: records-explicit
SRFI 76 explicit-naming syntactic layer

Library: records-implicit
SRFI 76 implicit-naming syntactic layer (subsumes explicit-naming layer)

Library: records-reflection
SRFI 76 explicit-naming syntactic layer

Library: hash-tables
Hash tables, hash functions (latter possibly separate library).

Library: r6rs-small
This library provides basic Scheme features, and excludes certain less 
essential features such as fixnum- and flonum-specific operations, and 
multiple value handling forms.  It is composed of the following libraries:


Library: r6rs
This library provides a fairly complete set of R6RS features, excluding 
certain libraries not considered part of the base R6RS language, e.g. 
promises, hash tables, and the eval library.  Composition:


Library: r6rs-big
This library provides all features defined in the R6RS.  Composition:


Issue: R5RS support
Should an R5RS compatibility library be specified?  If so, should it be 
specified as an alternative to r6rs-core?  This assumes that r6rs-core 
is not considered sufficiently r5rs-compatible.  Alternatively, should 
r6rs-core be refactored to allow an R5RS compatibility library to depend 
on it?


More information about the R6RS mailing list