summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Daphne Preston-Kendal 2021-12-29 19:22:00 +0100
committerGravatar Daphne Preston-Kendal 2021-12-29 19:22:00 +0100
commitb0431e3249640014c05cdec3450ea0737295e8d8 (patch)
tree75e27537703dacb0ba953ac02763d18212f14391
parentAdd missing space (diff)
Issue: type-test argument to make-product-comparator may be unneeded
-rw-r--r--srfi-228.html1
1 files changed, 1 insertions, 0 deletions
diff --git a/srfi-228.html b/srfi-228.html
index 407a279..6386904 100644
--- a/srfi-228.html
+++ b/srfi-228.html
@@ -53,6 +53,7 @@
<dt><code>(make-product-comparator</code> <var>type-test</var> <var>comparator</var> ... <code>)</code> (Procedure)
<dd>
<p>Returns a comparator which compares values satisfying the given predicate <var>type-test</var> by comparing them with each of the given comparators in turn, left to right, and returning the result of the first non-equal comparison. If all the given comparators consider two values equal, the product comparator also considers them equal. The hash function of the product comparator hashes together the results of all the given comparators in an implementation-defined way. If the equality or ordering predicates or the hash function of any of the given comparators is <code>#f</code>, the corresponding procedure in the product comparator will also be <code>#f</code>.</p>
+ <p class=issue>Is the <var>type-test</var> argument needed? It could easily be defined by <code>(lambda (x) (every (lambda (cmp) ((comparator-type-test cmp) x)) comparators))</code>, by analogy to <code>make-sum-comparator</code>.
<p class=issue>Add example.</p>
<dt><code>(make-sum-comparator</code> <var>comparator</var> ... <code>)</code> (Procedure)