This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home. For a version of this page that may be more recent, see NonFiniteSyntax in WG2's repo for R7RS-large.

Non­Finite­Syntax

aag
2012-03-29 01:44:04
2Sort implementations to make them easier to find. Added information in MIT Scheme syntax for infinities.history
source

Here's how various Schemes deal with syntax for non-finite inexact numbers. "Standard syntax" means what R6RS prescribes: +inf.0 for positive infinity, -inf.0 for negative infinity, and +nan.0 (or -nan.0) for NaN. The current draft of R7RS does not prescribe -nan.0; it is under ballot at this writing.

Racket, Gauche, Chicken (with or without the numbers egg), Bigloo, Scheme48, Guile, Kawa, Chez, Ikarus/Vicare, Larceny, Ypsilon, Mosh, IronScheme, STklos, Spark accept and print the standard syntax.

Gambit, Chibi accept and print the standard syntax, except that they do not accept -nan.0.

SigScheme, Scheme 9, Dream, Oaklisp, Owl Lisp are excluded because they do not have inexact non-finite numbers.

MIT has full control over floating-point exceptions. To ignore exceptions, one must do (flo:ignore-exception-traps thunk).

The following table concisely describes the other Schemes in the test suite. "Std syntax" is "yes" if the Scheme can read the standard syntax, "print" shows what (let* ((i (* 1.0e200 1.0e200)) (n (- i i))) (list i (- i) n)) prints, and "own syntax" is "yes" if the Scheme can reread what it prints.

Scheme

std syntax

prints

own syntax

TinyScheme

no

(inf -inf -nan)

no

BDC

no

(Infinity -Infinity NaN)

no

Elk

no

(inf -inf -nan.0)

no

Inlab

no

(inf.0 -inf.0 -nan.0)

no

KSi

yes

(+inf.0 -inf.0 nan.0)

yes

MIT

no

**

yes

NexJ

yes

(Infinity -Infinity NaN)

no

Rep

no

(inf. -inf. -nan.)

no

RScheme

no

(inf. -inf. -nan.)

no

Scheme 7

no

(inf.0 -inf.0 -nan.0)

no

Schemik

no

(inf -inf -nan)

no

SCM

*

(+inf.0 -inf.0 0/0)

yes

scsh

no

(inf. -inf. -nan.)

no

Shoe

no

(inf -inf -nan)

no

SISC

no

(infinity.0 -infinity.0 nan.0)

no

SXM

no

(inf.0 -inf.0 -nan.0)

no

UMB

no

(inf.0 -inf.0 -nan)

no

VX

yes

(inf. -inf. -nan.)

no

XLisp

no

(inf -inf -nan)

no

[*] Accepts +inf.0 and -inf.0 but not +nan.0 or -nan.0

[**] Prints #[+inf] and #[-inf] for infinities. Will add info on NaNs when I have it. -- ArthurGleckler