Shiro Kawai <xxxxxx@gmail.com> schrieb am Di., 18. Juli 2017 um 10:10 Uhr:
On Mon, Jul 17, 2017 at 9:29 PM, Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:

After having thought of this a bit more, I understand why this proposal is desirable. If we make mappings/hashmaps unequal when they don't share a comparator, however, this would clash with the proposed extension of ’=?’, wouldn't it? An extended version ’=?’ could report the equality of two mappings while the mapping comparator would yield ‘#f’. I think, we have to agree on one semantics.

Could you explain more?  My intention is (=? (make-mapping-comparator x) mapping-a mapping-b) => #f if mapping-a and mapping-b doesn't share the same comparator, and I think there's no clash.

Ah yes, then there is no clash.

(I previously thought, you would also like to make it possible to extend =? so that it may return #t if the mappings are equal in a mathematical sense.)
 

 
 
--

Marc


For make-mapping-comparator, we would also have to define a total order on the set of key-comparators involved so that the comparator returned by make-mapping-comparator is able to provide an ordering predicate.

How could we do this?

We can leave it to each implementation; some rejects it, and some may handle it gracefully.  The proposed suggestion is mostly relevant to hashmaps, but if we do adopt it for hashmaps, we might want to keep symmetry with mappings, too.
 


To unsubscribe from this list please go to http://www.simplelists.com/confirm.php?u=rBAxDxCgJFjJUssha9ixdMZU57qO20An