Re: srfi-114 reference implementation fixes John Cowan 16 Nov 2014 15:47 UTC

Shiro Kawai scripsit:

> (1) When /rounding/ argument is a procedure, it is invoked with
>     a single argument (/ x epsilon), while the srfi-114 document
>     says it should be called with two arguments, x and epsilon.


> (2) It uses inexact-real-hash for the hash function, which delegates
>     to number-hash to hash numbers.  However, the hash function
>     should take the rounding mode into account, to satisfy the
>     constraint that hash values for x and y must be equal when
>     x and y are equal w.r.t. the compare procedure.


> Actually I find the srfi text of make-listwise-comparator is not
> clear; is it actually intended to apply comparator to cars and then
> cdrs, as the reference implementation shows, or is it intended to
> apply comparator on cars, looping over lists' spine, as
> make-list-comparator does?

The latter: the implementation is wrong.  List-comparator,
make-list-comparator, and make-listwise-comparator are all intended to
be compatible.  This is what comes of not having a test suite.


I've written the revised source to
<>; it should migrate
to in due course.

If you have a test suite for comparators, I'd appreciate a pointer or copy.

John Cowan
We call nothing profound that is not wittily expressed.
        --Northrop Frye (improved)