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

Re: [Scheme-reports] R7RS-large comparators



On 07/12/2013 07:01 AM, Andrew Robbins wrote:
> This is a comment about
>
> http://trac.sacrideo.us/wg/wiki/ComparatorsCowan
>
> I noticed some issues and should like to make comments about this possible SRFI/module.
>
> General Issues:
> It is my personal opinion that this module should be helpful to anyone involved in either total orders or partial orders, such as floating-point numbers (which
> form a total order if you ignore NaNs and -0.0). One way of doing this would be to use an exception/condition to express a lack of total order, another would be
> to return something other than -1, 0, 1 from the compare procedure (perhaps return +nan.0), which would violate the conditions for a compare procedure according
> to this module as specified so far. I'm not sure what the best way to do this is, except to provide additional procedures for floating-point numbers, and not
> handle partial orders in a general way. My intuition tells me that a general approach would be more valuable in the long term, than to special case floats.
> Treating any and all partial orders that come along as special cases, just seems wrong to me.

On floating point numbers it would make sense (to me anyway) to return -0.0
in the case of a comparison of +0 and -0, and return NaN in the case of any
comparison involving NaNs.

But that's just for floating point.  I don't have any ideas about a general
case for the comparison semantics of unordered pairs.


				Bear

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