R7RS-small groups its bindings into libraries whose names start scheme, and R6RS into libraries that start rnrs. This page lists every library of both with its exports, taken from chapter 6 and appendix A of R7RS-small and from the index of the R6RS libraries document. The first library of each report is the base; the others separate features that not every implementation has, or that are expensive to load. Every name below is one the viewer colours as syntax, a function or a type.
Libraries of R7RS-small
The scheme prefix is reserved for the report and its successors. Only (scheme base) is required of every implementation.
| Library | What it holds |
|---|---|
(scheme base) | The traditional core: syntax, lists, numbers, strings, vectors, bytevectors, ports, exceptions |
(scheme case-lambda) | case-lambda |
(scheme char) | Character and string procedures that need large Unicode tables |
(scheme complex) | Procedures useful with non-real numbers |
(scheme cxr) | The twenty-four compositions of three and four car and cdr |
(scheme eval) | Evaluating data as programs |
(scheme file) | Files |
(scheme inexact) | Procedures useful with inexact numbers |
(scheme lazy) | Lazy evaluation |
(scheme load) | Loading forms from files |
(scheme process-context) | The program’s calling context |
(scheme read) | Reading data |
(scheme repl) | The REPL environment |
(scheme time) | Time-related values |
(scheme write) | Writing data |
(scheme r5rs) | The identifiers of R5RS, except transcript-on and transcript-off; exact and inexact appear as inexact->exact and exact->inexact. Identifiers of libraries an implementation lacks are absent |
(scheme base)
* + - ... / < <= = => > >= _
abs and append apply assoc assq assv begin binary-port? boolean=? boolean?
bytevector bytevector-append bytevector-copy bytevector-copy! bytevector-length bytevector-u8-ref bytevector-u8-set! bytevector?
caar cadr call-with-current-continuation call-with-port call-with-values call/cc car case cdar cddr cdr ceiling
char->integer char-ready? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port close-port
complex? cond cond-expand cons current-error-port current-input-port current-output-port
define define-record-type define-syntax define-values denominator do dynamic-wind
else eof-object eof-object? eq? equal? eqv? error error-object-irritants error-object-message error-object?
even? exact exact-integer-sqrt exact-integer? exact? expt features file-error?
floor floor-quotient floor-remainder floor/ flush-output-port for-each gcd get-output-bytevector get-output-string guard
if include include-ci inexact inexact? input-port-open? input-port? integer->char integer?
lambda lcm length let let* let*-values let-syntax let-values letrec letrec* letrec-syntax
list list->string list->vector list-copy list-ref list-set! list-tail list?
make-bytevector make-list make-parameter make-string make-vector map max member memq memv min modulo
negative? newline not null? number->string number? numerator odd?
open-input-bytevector open-input-string open-output-bytevector open-output-string or output-port-open? output-port?
pair? parameterize peek-char peek-u8 port? positive? procedure? quasiquote quote quotient
raise raise-continuable rational? rationalize read-bytevector read-bytevector! read-char read-error? read-line read-string read-u8
real? remainder reverse round set! set-car! set-cdr! square
string string->list string->number string->symbol string->utf8 string->vector string-append string-copy string-copy! string-fill! string-for-each string-length string-map string-ref string-set!
string<=? string<? string=? string>=? string>? string? substring symbol->string symbol=? symbol? syntax-error syntax-rules
textual-port? truncate truncate-quotient truncate-remainder truncate/ u8-ready? unless unquote unquote-splicing utf8->string values
vector vector->list vector->string vector-append vector-copy vector-copy! vector-fill! vector-for-each vector-length vector-map vector-ref vector-set! vector?
when with-exception-handler write-bytevector write-char write-string write-u8 zero?
The other libraries
| Library | Exports |
|---|---|
(scheme case-lambda) | case-lambda |
(scheme char) | char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-foldcase char-lower-case? char-numeric? char-upcase char-upper-case? char-whitespace? digit-value string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-downcase string-foldcase string-upcase |
(scheme complex) | angle imag-part magnitude make-polar make-rectangular real-part |
(scheme cxr) | caaaar caaadr caaar caadar caaddr caadr cadaar cadadr cadar caddar cadddr caddr cdaaar cdaadr cdaar cdadar cdaddr cdadr cddaar cddadr cddar cdddar cddddr cdddr |
(scheme eval) | environment eval |
(scheme file) | call-with-input-file call-with-output-file delete-file file-exists? open-binary-input-file open-binary-output-file open-input-file open-output-file with-input-from-file with-output-to-file |
(scheme inexact) | acos asin atan cos exp finite? infinite? log nan? sin sqrt tan |
(scheme lazy) | delay delay-force force make-promise promise? |
(scheme load) | load |
(scheme process-context) | command-line emergency-exit exit get-environment-variable get-environment-variables |
(scheme read) | read |
(scheme repl) | interaction-environment |
(scheme time) | current-jiffy current-second jiffies-per-second |
(scheme write) | display write write-shared write-simple |
(scheme r5rs) | the R5RS names, including exact->inexact inexact->exact scheme-report-environment null-environment interaction-environment char-ready? load eval delay force and the car and cdr compositions of up to four letters |
The names else, =>, ..., _, unquote and unquote-splicing are auxiliary syntax: they have a meaning only inside the form that uses them, and are exported so that they can be matched as literals.
Feature identifiers
R7RS Appendix B names the identifiers an implementation may offer to cond-expand and features, and requires that it not offer one for a feature it lacks:
| Identifier | Meaning |
|---|---|
r7rs | Every R7RS implementation has it |
exact-closed | + - * expt (non-negative integer power) give exact results for exact inputs |
exact-complex | Exact complex numbers |
ieee-float | Inexact numbers are IEEE 754 binary floating point |
full-unicode | All Unicode 6.0 characters are Scheme characters |
ratios | / with exact arguments gives an exact result when the divisor is not zero |
posix, windows, and others such as unix, darwin, gnu-linux, bsd, freebsd, solaris | The operating system (perhaps several) |
i386, x86-64, ppc, sparc, jvm, clr, llvm | The processor or runtime |
ilp32, lp64, ilp64 | The C memory model |
big-endian, little-endian | Byte order |
| the implementation’s name, and its name with a version | For example chibi, chicken, guile, gauche (the report gives these as <name> and <name-version>) |
Libraries of R6RS
R6RS divides its libraries into the base and many others, and also defines (rnrs), which exports everything of the standard libraries except (rnrs eval), (rnrs mutable-pairs), (rnrs mutable-strings) and (rnrs r5rs) (the composite library chapter of the R6RS libraries document says exactly this, and that all its bindings are exported for both run and expand).
| Library | Exports (by group) |
|---|---|
(rnrs base) | Syntax: define define-syntax lambda quote if set! cond case and or let let* letrec letrec* let-values let*-values begin quasiquote unquote unquote-splicing let-syntax letrec-syntax syntax-rules identifier-syntax assert else => ... _. Procedures: the equivalence predicates; the numeric tower including real-valued? rational-valued? integer-valued? div mod div-and-mod div0 mod0 div0-and-mod0 exact-integer-sqrt exact inexact finite? infinite? nan?; booleans (boolean=?); pairs and lists; symbols (symbol=?); characters; strings; vectors (vector-map vector-for-each); errors (error assertion-violation); control (apply call-with-current-continuation call/cc values call-with-values dynamic-wind) |
(rnrs unicode) | char-upcase char-downcase char-titlecase char-foldcase char-ci=? and the other ci comparisons, char-alphabetic? char-numeric? char-whitespace? char-upper-case? char-lower-case? char-title-case? char-general-category string-upcase string-downcase string-titlecase string-foldcase string-ci=? and the other ci comparisons, string-normalize-nfd string-normalize-nfkd string-normalize-nfc string-normalize-nfkc |
(rnrs bytevectors) | See Lists, vectors and strings |
(rnrs lists) | find for-all exists filter partition fold-left fold-right remp remove remq remv memp member memv memq assp assoc assv assq cons* |
(rnrs sorting) | list-sort vector-sort vector-sort! |
(rnrs control) | when unless do case-lambda |
(rnrs records syntactic), (rnrs records procedural), (rnrs records inspection) | See Records |
(rnrs exceptions) | with-exception-handler guard raise raise-continuable |
(rnrs conditions) | See Error handling |
(rnrs io ports), (rnrs io simple) | See I/O ports |
(rnrs files) | file-exists? delete-file |
(rnrs programs) | command-line exit |
(rnrs arithmetic fixnums), (rnrs arithmetic flonums), (rnrs arithmetic bitwise) | See Procedures and numbers |
(rnrs syntax-case) | syntax-case syntax quasisyntax unsyntax unsyntax-splicing with-syntax make-variable-transformer identifier? bound-identifier=? free-identifier=? syntax->datum datum->syntax generate-temporaries syntax-violation ... _ |
(rnrs hashtables) | make-eq-hashtable make-eqv-hashtable make-hashtable hashtable? hashtable-size hashtable-ref hashtable-set! hashtable-delete! hashtable-contains? hashtable-update! hashtable-copy hashtable-clear! hashtable-keys hashtable-entries hashtable-equivalence-function hashtable-hash-function hashtable-mutable? equal-hash string-hash string-ci-hash symbol-hash |
(rnrs enums) | make-enumeration enum-set-universe enum-set-indexer enum-set-constructor enum-set->list enum-set-member? enum-set-subset? enum-set=? enum-set-union enum-set-intersection enum-set-difference enum-set-complement enum-set-projection define-enumeration |
(rnrs eval) | eval environment |
(rnrs mutable-pairs), (rnrs mutable-strings) | set-car! set-cdr!; string-set! string-fill! |
(rnrs r5rs) | delay force exact->inexact inexact->exact quotient remainder modulo null-environment scheme-report-environment |
The R5RS bindings
R5RS has no libraries: the whole language was in the one environment. Its index lists, among others, * + - / the comparisons, abs, acos, and, angle, append, apply, asin, assoc, assq, assv, atan, begin, boolean?, caar to cddddr, call-with-current-continuation, call-with-input-file, call-with-output-file, call-with-values, case, ceiling, char-ready?, close-input-port, close-output-port, complex?, cond, current-input-port, current-output-port, define, define-syntax, delay, display, do, dynamic-wind, eval, exact->inexact, force, if, inexact->exact, interaction-environment, lambda, let, let*, let-syntax, letrec, letrec-syntax, list-tail, load, make-polar, make-rectangular, null-environment, open-input-file, open-output-file, or, peek-char, quasiquote, quote, read, read-char, scheme-report-environment, set!, syntax-rules, transcript-off, transcript-on, values, with-input-from-file, with-output-to-file, write, write-char. R5RS marked eval, load, transcript-on and several others as optional, and R7RS removed transcript-on and transcript-off.
Not described
Known, not yet covered
- Reference: the exports of
(rnrs base)are given by group, not name by name, and the exports of(rnrs bytevectors),(rnrs records ...),(rnrs conditions),(rnrs io ...)and the arithmetic libraries are on the pages named in the table; none of those lists was checked name by name against the report’s library tables (the PDF could not be read), only against its index. - Reference: the contents of the R6RS
(rnrs r5rs)and(rnrs control)are from the library index, not from their chapters. - Reference: the libraries that the implementations ship (Guile’s
(ice-9 ...), CHICKEN’s(chicken ...), Chez’s(chezscheme), Gauche’sgauche.*, MIT/GNU’s) are not listed.
See also
- Libraries and modules – how a library is defined and imported
- SRFI – the libraries of the SRFIs
- History and standards – what each report added