summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Daphne Preston-Kendal 2021-12-29 17:48:01 +0100
committerGravatar Daphne Preston-Kendal 2021-12-29 17:48:01 +0100
commit8c7d09b758bb04b07b9c89a7a46c8f89a3de651c (patch)
treea6b39248d22fef25492ca4c4aeb8cb7aca4805e0
parentit’s an SRFI (diff)
Nix compose-comparator syntax, rename composed to product comparator
-rw-r--r--composing-comparators.scm24
-rw-r--r--srfi-228.html7
2 files changed, 2 insertions, 29 deletions
diff --git a/composing-comparators.scm b/composing-comparators.scm
index c6b6c7d..3356797 100644
--- a/composing-comparators.scm
+++ b/composing-comparators.scm
@@ -16,7 +16,7 @@
((comparator-hash-function contents-comparator) x))
#f)))
-(define (make-composed-comparator type-test . comparators)
+(define (make-product-comparator type-test . comparators)
(make-comparator
type-test
(if (every comparator-equality-predicate comparators)
@@ -43,28 +43,6 @@
(list->generator comparators))))
#f)))
-(define-syntax compose-comparator
- (syntax-rules ()
- ((_ type-test (unwrap . more) ...)
- (make-composed-comparator
- type-test
- (let-values (((unwrap cmp) (compose-comparator-form unwrap . more)))
- (make-wrapper-comparator
- (comparator-type-test-predicate cmp)
- unwrap
- cmp)) ...))))
-
-(define-syntax compose-comparator-form
- ;; Using this submacro enables enforcement of the correct form with
- ;; moderately more useful syntax errors than doing it the SRFI 9
- ;; way, at least within the limited bounds of what one can do for
- ;; that in syntax-rules.
- (syntax-rules ()
- ((_ unwrap) (compose-comparator-form unwrap (make-default-comparator)))
- ((_ unwrap cmp)
- (values
- unwrap cmp))))
-
(define (comparison-procedures comparator)
(values
(lambda args (apply <? comparator args))
diff --git a/srfi-228.html b/srfi-228.html
index 6f9bf7b..f5f0eb5 100644
--- a/srfi-228.html
+++ b/srfi-228.html
@@ -46,15 +46,10 @@
<dd>
<p>Returns a comparator which compares values satisfying the predicate <var>type-test</var> by first calling the given <var>unwrap</var> procedure on them, then comparing the output of that procedure with the given <var>contents-comparator</var>. The hash function of the wrapper comparator returns the same value as the <var>contents-comparator</var> run on the unwrapped value.</p>
- <dt><code>(make-wrapper-comparator</code> <var>type-test</var> <var>comparator</var> ... <code>)</code> (Procedure)
+ <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 <covarde>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 composed comparator also considers them equal. The hash function of the composed comparator hashes together the results of all the given comparators in an implementation-defined way.</p>
- <dt><code>(compose-comparator</code> <var>type-test</var> <code>(</code><var>unwrap</var> <var>comparator</var><code>)</code> ...)</code> (Syntax)
- <dd>
- <p>Expands to a form which returns a comparator which compares values satisfying the given predicate <code>type-test</code> by running in turn, left to right, wrapper comparators made out of the given <code>unwrap</code> and <code>comparator</code>, according to the rules for <code>make-composed-comparator</code>. <code>comparator</code> may be omitted from each form, in which case the SRFI 128 default comparator is used.</p>
- <p>This is equivalent to using the procedural forms <code>make-composed-comparator</code> and <code>make-wrapper-comparator</code> together.</p>
-
<dt><code>(comparison-procedures</code> <var>comparator</var><code>)</code> (Procedure)
<dd>
<p>Returns five values, variadic procedures corresponding to <code>&lt;</code>, <code>&lt;=</code>, <code>=</code>, <code>&gt;=</code>, and <code>&gt;</code> respectively for the given comparator. Each one is equivalent to a partial application of the SRFI 128 procedures <code>&lt;?</code>, <code>&lt;=?</code>, <code>=?</code>, <code>&gt;=?</code>, and <code>&gt;?</code> with the given comparator.</p>
67ab 2003-04-07new_handle_on_port() error path fix from Jim RadfordGravatar dmaas 1-1/+3 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@105 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-03-26add raw1394_new_handle_on_port() convenience functionGravatar dmaas 2-1/+41 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@104 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-02-22Updates for new rawiso ioctl interface.Gravatar bencollins 3-37/+125 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@103 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-15add iso_xmit_sync() and iso_xmit_write(); clean up iso handling a bitGravatar dmaas 5-39/+161 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@102 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-15implement tag matching for rawiso receptionGravatar dmaas 3-4/+12 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@101 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-06back out previous commit - don't drop the legacy API just yetGravatar dmaas 6-173/+130 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@100 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-05emulate legacy ISO reception API on top of new rawiso APIGravatar dmaas 7-131/+174 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@99 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-24update iso API for multi-channel reception and new packet buffer layoutGravatar dmaas 4-123/+236 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@98 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20oops, irq_interval needs to be signedGravatar anonymous 1-1/+1 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@97 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20dmaas - renamed exported arm definitions into the raw1394_ namespace; ↵Gravatar anonymous 3-124/+48 brought kernel-raw1394.h back in sync with the kernel version git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@96 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-16rawiso updates:Gravatar dmaas 3-18/+25 - changed return type of rawiso xmit/recv handlers from int to enum raw1394_iso_disposition - added an ioctl (RAW1394_ISO_QUEUE_ACTIVITY) to force an ISO_ACTIVITY event into the queue. This is needed for handling RAW1394_ISO_DEFER, to kick us out of the next read() instead of sleeping forever. - removed references to "8-byte" isochronous header - this is an OHCI-specific implementation detail git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@95 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18fix cplusplus extern C blockGravatar ddennedy 1-4/+4 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@94 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18merged rawiso branchGravatar ddennedy 7-6/+488 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@93 53a565d1-3bb7-0310-b661-cf11e63c67ab