Skip to content
Felix S. Klock II edited this page Jul 28, 2013 · 3 revisions

== Spanky mode ==

Larceny's R6RS-conforming mode, nicknamed "Spanky", is intended for testing the portability of R6RS programs. Toward that end, it provides as few optional features as possible (since all such features are non-portable), and sacrifices performance in order to detect violations and uses of non-portable features. Programs that have been tested in Larceny's R6RS-conforming mode will be more likely to run in other implementations of R6RS Scheme than programs that have been tested only in Larceny's R6RS-compatible mode. On the other hand, programs that appear to run correctly in less rigorous implementations of R6RS Scheme may contain latent portability bugs that will prevent them from running in Larceny's R6RS-conforming mode. Those programs will probably run in Larceny's R6RS-compatible mode, however.

Spanky mode will enforce all implementation restrictions mandated by the R6RS. In addition, it will attempt to enforce additional restrictions that are merely recommended or permitted by the R6RS, and will also explore some dark corners where latent bugs are likely to lurk in seemingly R6RS-conformant programs. Some of the ways in which Spanky mode will surpass its R6RS obligations are noted here.

No Lexical Extensions

Spanky will not recognize any extensions to the lexical syntax mandated by the R6RS.

No Unsafe Programs

Spanky will not run a program unless it is said to be safe.

Multiple Return Values

Spanky will check to make sure that the number of return values matches the number expected by the continuation whenever the R6RS allows such checking.

Immutable Values

Spanky will detect attempts to mutate an immutable value.

Unspecified Behavior

Spanky will endeavor to behave in surprising ways whenever its behavior is unspecified by the R6RS.

Procedure Calls

Spanky will choose different orders in which to evaluate the subforms of a procedure call.

Libraries

Spanky will support only the standard libraries that are described in the R6RS, along with the libraries that are contained within the file that contains the top-level program. No mechanism for splitting a program into multiple files will be provided, since the R6RS does not mandate any such mechanism.

Spanky will distinguish or not distinguish, at its whim, instances of a library for different phases. This will assist with testing for latent bugs in programs that, contrary to the draft R6RS, expect libraries to have a consistent semantics.

Top-level Semantics

Spanky will try to find a reasonably perverse interpretation of top-level semantics, to assist with testing for latent bugs in programs that, contrary to the draft R6RS, expect all implementations to have a consistent top-level semantics.

Equivalence Predicates

Spanky will attempt to use several different semantics for eqv? and eq?, while taking care to satisfy all R6RS requirements for these predicates.

Single Precision Flonums

Spanky may use IEEE single precision flonums instead of the IEEE double precision used by Larceny's R6RS-compatible mode, or may round to single before storing into a destination.

Infinities and NaNs

Spanky may not be able to represent infinities or NaNs, or may use signalling NaNs, or may raise an exception when it sees the lexical syntax for an infinity or NaN (as allowed by section 9.9.2 of the current draft R6RS). (The -but-not-that-pedantic command-line switch will disable this feature.)

max and min

Spanky will raise an exception when one of these procedures is passed arguments of differing exactness, and the numerical value of the result cannot be represented as an inexact number without loss of exactness. (The -but-not-that-pedantic command-line switch will disable this feature.)

number->string

Spanky will require the radix to be 2, 8, 10, or 16, even if the R6RS allows (but does not require) other radixes.

Lists

Spanky will perform more checking than is required of procedures such as map and for-each.

Quasiquotation

Spanky will explore the underspecified behavior of quasiquotation.

Normalization of Strings

Spanky will decide randomly whether to copy a string that is already in the specified form.

Endianness

Spanky's native endianness will not be the endianness that most programmers would expect for the target processor. For example, it might be big-for-bytevectors-but-little-for-floats. (The -but-not-that-pedantic command-line switch will disable this feature.)

Eol Style

Spanky's (native-eol-style) may be spanky, which will not be accepted by the eol-style syntax or make-transcoder procedure. (The -but-not-that-pedantic command-line switch will disable this feature.)

Default transcoder

If no transcoder is specified when opening a text file, then Spanky will select a transcoder at random. (The -but-not-that-pedantic command-line switch will disable this feature.)

Side effects and bytevector/string input ports

Spanky might or might not copy a bytevector or string before opening an input port that delivers the contents of the bytevector or string.

syntax-case

We don't know exactly how Spanky will process syntax-case macros. Neither will you.

Clone this wiki locally