[R6RS] string->number

Michael Sperber sperber at informatik.uni-tuebingen.de
Wed Aug 30 13:45:34 EDT 2006


dyb at cs.indiana.edu writes:

>> 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.
>
> That's what I thought.  But you claimed the proof would have to be made
> for "all substitutions of exact numbers for the inexact ones", which means
> that I can't reduce (/ 0 3.5) to 0 because if I were to substitute 0 for
> 3.5 in (/ 0 3.5) I would get (/ 0 0) which (we both agree) is not 0.

The wording of the second sentence you cite doesn't apply in this
case.  It also doesn't apply in the case of (/ 0 +0.0).  I believe
Will thought that it might erroneously have served as the rationale
for allowing (/ 0 +0.0) => 0.  I think a natural consequence of the
wording you cite is indeed (/ 0 3.5) => +nan.0.  That's fine with me.

> Perhaps you meant to imply some sort of equivalence in the substitution. 
> But all exact equivalents of +0.0 and -0.0 are nonzero, 

That's false in all Scheme implementations I know, and would be an
unwise model.  At the risk of incurring more of Will's and your wrath,
I'll refer to the relevant section ("The case against rational -0") in
Egner et al.'s 2004 Scheme Workshop paper which discusses pretty much
exactly this issue.

> Really?  What about these two examples in base.tex:
>
> (* 0 +inf.0)                           \ev  0 \textit{or} +nan.0
> (* 0 +nan.0)                           \ev  0 \textit{or} +nan.0

That's what we're talking about; Will and I would like to change it.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



More information about the R6RS mailing list