Opened 6 years ago

Closed 6 years ago

#218 closed defect (wontfix)

infinity/nan syntax

Reported by: alexshinn Owned by: alexshinn
Priority: major Milestone:
Component: WG1 - Reader Syntax Keywords:


The current BNF for symbol syntax is rather
cumbersome, having to account for the fact
that +inf.0, -inf.0 and +nan.0 are numbers
even though they do not begin with a numeric

A simple solution would be to use an alternative
such as 0/1, 0/-1 and 0/0, respectively. These
are shorter, more self explanatory, and do not
conflict with the definition of symbol syntax.

Change History (2)

comment:1 Changed 6 years ago by cowan

Standardization is not about inventing new stuff unless we have to. Currently:

  • Racket, Gauche, Gambit, Chicken (with some bugs), Guile, Kawa, Chibi, Chez, SCM, Ikarus, Larceny, IronScheme, Ypsilon, Mosh, STklos support the +inf.0, -inf.0, +nan.0 syntaxes.
  • Bigloo prints +Infinity, -Infinity, Infinity on output but treats these as symbols on input.
  • Scheme48 prints #{Inf}, #{-Inf}, #{NaN} but does not accept these syntaxes on input.
  • SISC prints infinity.0, -infinity.0, nan.0 but treats these as symbols on input.
  • SigScheme doesn't do flonums.
  • MIT Scheme, scsh report errors and so needs no such syntax.
  • Scheme 9 reports errors for the infinities and evaluates (/ 0.0 0.0) to 0.0.

In addition, those syntaxes look exact, not inexact. You could fix that with a decimal point, but people would tend to forget where it went (is it 0./1, 0.0/1, 0/1., 0/1.0, some of these, all of these?)

comment:2 Changed 6 years ago by cowan

  • Resolution set to wontfix
  • Status changed from new to closed

WG1 rejected this proposal.

Note: See TracTickets for help on using tickets.