[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
> 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. :-)
I concur with Mark and Per. I think the current definition of eqv? for non-IEEE inexact numbers is dangerously odd and the standard would be improved by, at least, leaving the behavior to the implementation.
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. Therefore, if I want to use R7RS and want an eqv? that reflects operational equivalence on inexact numbers, I will:
* Use the R7RS eqv? on implementation with IEEE inexact numbers;
* Use the suitable native eqv?, if one exists, on implementations with non-IEEE inexact numbers; and
* Use a portable eqv? on other implementations with non-IEEE inexact numbers.
The R7RS library system makes this quite easy to implement this. For this, and of course for much else, the editors should be highly commended.
So, while I think the definition of eqv? is, uh, a hideous wart on the R7RS, I'm not too worried about its practical impact on my code.
Regards,
Alan
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports