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

cowan
2012-03-29 05:52:45
6history
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:ignoring-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. The implementations are listed in roughly decreasing order of standardosity.

Scheme

std syntax

prints

own syntax

KSi

yes

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

yes

NexJ

yes

(Infinity -Infinity NaN)

no

VX

yes

(inf. -inf. -nan.)

no

SCM

*

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

yes

Scheme 7

no

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

no

SXM

no

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

no

Inlab

no

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

no

UMB

no

(inf.0 -inf.0 -nan)

no

Shoe

no

(inf -inf -nan)

no

TinyScheme

no

(inf -inf -nan)

no

XLisp

no

(inf -inf -nan)

no

Schemik

no

(inf -inf -nan)

no

scsh

no

(inf. -inf. -nan.)

no

Rep

no

(inf. -inf. -nan.)

no

RScheme

no

(inf. -inf. -nan.)

no

Elk

no

(inf -inf -nan.0)

no

SISC

no

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

no

BDC

no

(Infinity -Infinity NaN)

no

MIT

no

(#[+inf] #[-inf] #[NaN])

no

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