[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Formal Comment: R7RS 'eqv?' cannot be used for reliable memoization



On Tue, Nov 13, 2012 at 3:13 PM, Alan Watson <alan@x> wrote:
> I think -0.0 is a hideous wart that in a good implementation
> would not even exist

> I think the existence of #\null at all is a wart, and
> a throw-back to languages like C which require it.

Well, at least Alex is consistent in his opinions. :-)

:)

Note that what I want in a language, and what I want in
a standard, and what I think is appropriate for R7RS given
our charter and goals are all separate things.

On these two issues I just want it to be possible to
have an ideal Scheme implementation where characters
are really parts of scripts and numbers are really
mathematical values.
 
However, I'm not losing too much sleep. I suspect that implementations that have signed zero but are not IEEE will implement a fast native eqv? that behaves as (eqv? -0.0 +0.0) => #f and a slower R7RS eqv? that behaves as (eqv? -0.0 +0.0) => #t.

Signed zero is primarily used by IEEE.  MPFR describes itself in terms of IEEE.
The MPFR signed zero should therefore naturally behave like IEEE, and I don't
think a conforming implementation need even make a disclaimer.

Note R7RS eqv? need not be slower in either case.  The recommended
approach is to simply compare the bit patterns of the floats (potentially
faster than = if the values aren't already in the FP stack).

-- 
Alex

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