This chapter explains which features of the R6RS standard libraries are available in each of Larceny's major modes of execution.
Larceny was the first substantially complete implementation of the R6RS. Any features that are missing from R6RS modes are missing because of bugs or because the features are deprecated in Larceny. The most up-to-date listing of Larceny's known deviations from the R6RS standard can be found on the web page that describes the current status of Larceny's R6RS-compatible mode.
Larceny is R6RS-compatible but not R6RS-conforming. When Larceny is said to support a feature of the R6RS, that means the feature is present and will behave as specified by the R6RS so long as no exception is raised. Larceny does not always raise the specific conditions specified by the R6RS, and does not perform all of the checking for portability problems that is mandated by the R6RS. These deviations do not affect the execution of production code, and do not compromise Larceny's traditional safety.
ERR5RS and R6RS modes support all procedures and syntaxes
exported by the (rnrs base)
library.
Larceny's R5RS mode does not support library
, import
, or
identifier-syntax
.
The semantics of quasiquote
, let-syntax
, and letrec-syntax
differ between the R5RS and the R6RS. Larceny's R5RS mode still
supports the R5RS semantics.
All of Larceny's modes support all features of the (rnrs unicode)
library.
Larceny v0.97 conforms to The Unicode Standard, Version 5.0.
ERR5RS and R6RS modes support all procedures and syntaxes
exported by (rnrs bytevectors)
, but the endianness
syntax is deprecated because it is redundant with quote
.
Larceny's R5RS mode does not support endianness
.
In Larceny, any symbol names a supported endianness.
The symbols big
and little
have their expected meanings.
All other symbols mean (native-endianness)
with respect
to integer operations, but mean the opposite of
(native-endianness)
with respect to
IEEE-754 operations.
For string operations, the endianness must be the symbol
big
or the symbol little
. All of these extensions are
permitted by the R6RS standard.
Larceny's utf16->string
and utf32->string
accept one,
two, or three arguments. The R6RS specification of these
procedures does not allow them to accept a single argument,
but that is believed to be an error in the R6RS.
ERR5RS and R6RS modes support all procedures and syntaxes
exported by
(rnrs records procedural)
,
(rnrs records inspection)
, and
(rnrs records syntactic)
.
Those libraries are deprecated, however;
the make-record-constructor-descriptor
procedure does
not simplify unusually complex cases enough to justify
the complexity it adds to typical cases, and
the entire syntactic layer is gratuitously incompatible
with the procedural layer.
Larceny's R5RS mode supports all features of the deprecated
(rnrs records procedural)
and (rnrs records inspection)
libraries. R5RS mode does not support (rnrs records syntactic)
.
All of Larceny's modes support all features of the
(err5rs records procedural)
and
(err5rs records inspection)
libraries. ERR5RS and R6RS modes also support the
(err5rs records syntactic)
library.
These libraries are equivalent to the
(srfi :99 records procedural)
,
(srfi :99 records inspection)
, and
(srfi :99 records syntactic)
libraries.
The record definition syntax of
SRFI 9
is a proper subset
of the syntax provided by the (err5rs records syntactic)
library. In R5RS mode, SRFI 9 can be loaded dynamically
using the
require
procedure:
> (require 'srfi-9)
We recommend the ERR5RS and/or SRFI 9 libraries be used instead of the corresponding R6RS libraries.
The R6RS spouts some tendentious nonsense about procedural records being slower than syntactic records, but this is not true of Larceny's records, and is unlikely to be true of other implementations either.
Larceny continues to support its old-style records, which are almost but not quite compatible with ERR5RS and R6RS records. This can be confusing, since some of Larceny's procedures have the same names as R6RS procedures. That has made it necessary to overload those procedures to work with both old-style and R6RS records. We apologize for the mess.
All of Larceny's modes support all features of the
(rnrs exceptions)
and (rnrs conditions)
libraries.
ERR5RS and R6RS modes support all names exported by the
(rnrs io ports)
, (rnrs io simple)
, and
(rnrs files)
libraries.
The buffer-mode
, eol-style
, and error-handling-mode
syntaxes are deprecated because they are redundant
with quote
. These deprecated syntaxes may be provided
in the form of procedures rather than syntax, but this
deviation from R6RS semantics cannot be detected by
portable R6RS programs.
Larceny's R5RS mode supports all non-deprecated features of those libraries.
Larceny supports four distinct buffer modes: none
,
line
, datum
, and block
. The R6RS requires
the buffer-mode
syntax to raise an exception for the
datum
buffer mode, which is the buffer mode Larceny
uses for interactive output ports.
In Larceny, any symbol names a supported end-of-line style. All end-of-line and error-handling-mode symbols whose meanings are not described by the R6RS have locale-dependent meanings, which is an extension permitted by the R6RS standard.
Although Larceny supports the UTF-16 codec, it is not really useful on Windows machines (where it should be most useful) because Larceny's low-level file system mimics a byte-oriented Unix file system even on Windows. This problem should be addressed in some future version of Larceny.
The most up-to-date list of known deviations from R6RS io semantics can be found on the web page that describes the current status of Larceny's R6RS-compatible mode.
ERR5RS and R6RS modes support the (rnrs programs)
library.
Larceny's R5RS mode provides the exit
procedure but
not the command-line
procedure of that library.
Larceny's traditional command-line-arguments
procedure
can be used to implement an approximation to command-line
.
For a definition, see lib/R6RS/rnrs/programs.sls
.
All of Larceny's modes support all features of the
(rnrs arithmetic fixnums)
,
(rnrs arithmetic flonums)
, and
(rnrs arithmetic bitwise)
libraries.
R6RS fixnum and flonum operations may be slower than the corresponding generic operations, since the fixnum and flonum operations are required to check their arguments and may also have to check their results. Isolated operations in small micro-benchmarks are likely to be slower than groups of similar operations in larger programs, however, because the Twobit compiler removes redundant checks and propagates type information.
ERR5RS and R6RS modes support the (rnrs syntax-case)
library.
Larceny's R5RS mode does not.
All of Larceny's modes support all features of the
(rnrs hashtables)
library.
Larceny's traditional make-hashtable
procedure has been
renamed to make-oldstyle-hashtable
.
When you use Larceny's R5RS or ERR5RS mode to dump a heap image
that contains eq?
or eqv?
hashtables you have created, they
are automatically reset so they will
rehash themselves whenever you begin a new session with the
dumped heap.
ERR5RS and R6RS modes support the (rnrs enums)
library.
Larceny's R5RS mode provides all of the procedures exported by
(rnrs enums)
but does not provide the define-enumeration
syntax.
ERR5RS and R6RS modes support the (rnrs eval)
library.
Larceny's R5RS mode provides an R5RS-compatible eval procedure,
not an R6RS-compatible eval procedure, and does not provide the
environment
procedure.
All of Larceny's modes support all features of the
(rnrs mutable-pairs)
and (rnrs mutable-strings)
libraries.