[R6RS] string->number

William D Clinger will at ccs.neu.edu
Wed Aug 30 12:48:31 EDT 2006

Kent wrote:
> True, but it shouldn't preclude a sensible implementation based on IEEE
> arithmetic.

That's a red herring.  Nobody is advocating anything
that would preclude a sensible implementation based
on IEEE arithmetic.  It is the insensible ones that
are being questioned.

> > More importantly, implementations are not supposed
> > to return an exact number for things like (/ 0 0.0)
> > unless they can prove that the result they want to
> > return is the correct result for all substitutions
> > of exact numbers for the inexact ones.
> Is this new in R6RS?

No.  The behavior of (/ 0 0.0) in Chez Scheme and MzScheme
is as illegal under the R5RS semantics as under the R6RS.

> If so, I object.  The R5RS requirement was less
> stringent

No, it wasn't.  R5RS 6.2.2 says:

    With the exception of inexact->exact, the operations
    described in this section must generally return
    inexact results when given any inexact arguments. An
    operation may, however, return an exact result if it
    can prove that the value of the result is unaffected
    by the inexactness of its arguments. For example,
    multiplication of any number by an exact zero may
    produce an exact zero result, even if the other
    argument is inexact.

> and, by the way, specifically allowed (* 0 x) to be 0 for any
> number x including, presumably, NaNs.

That is another red herring.  Everyone agrees that, for
all exact numbers x, an exact 0 is the correct result of
(* 0 x).  Therefore everyone agrees that both the R5RS
and R6RS allow (* 0 x) to evaluate to an exact 0 for any
number x.


More information about the R6RS mailing list