Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0 John Cowan (20 Dec 2012 21:52 UTC)

Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0 John Cowan 20 Dec 2012 21:49 UTC

Vassil Nikolov scripsit:

>   Well, I believe that another point of view is preferable, namely,
>   that (imag-part z) => 0 means that z is (certainly) a real number
>   and that (imag-part z) => 0.0 means that z is a complex number very
>   near and possibly, but not necessarily, on the real axis [*].
>   (Therefore, (imag-part 2.0) => 0.)  But that's just my 2/100+0i.

I agree, and so did the R6RS team, and so did the R7RS WG at one time.
But we ended up deciding that it was too subtle a change from the
established R5RS semantics that a number is real iff its imaginary part
is zero, exact or inexact.  People's programs might stop working without
their understanding quite why.

R6S provides a workaround in the form of `real-valued?`,
`rational-valued?`, and `integer-valued?` procedures, which provide
the R5RS semantics (though without saying so).  But our WG felt that
nobody would be able to remember the difference between `real?` and
`real-valued?` in actual use.

The Pure language, which doesn't have historical baggage, uses the R6RS
interpretation.

--
May the hair on your toes never fall out!       John Cowan
        --Thorin Oakenshield (to Bilbo)         cowan@ccil.org

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports