summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arvydas Silanskas 2021-08-22 20:54:14 +0300
committerGravatar Arvydas Silanskas 2021-08-22 20:54:14 +0300
commite943ef133b857839bd5d9cdc2197fe7f03a09349 (patch)
treead0cc4ddd3ddd9d237f25f6e9f68bcbbd9049dd1
parentclean up (diff)
parenttypo, -comparator can return #f (diff)
merge, add unfold
-rw-r--r--srfi-225-test.scm70
-rw-r--r--srfi-225.html189
l---------srfi/225.scm1
-rw-r--r--srfi/225.sld92
-rw-r--r--srfi/alist-impl.scm31
-rw-r--r--srfi/default-impl.scm113
-rw-r--r--srfi/externals.scm99
-rw-r--r--srfi/indexes.scm101
-rw-r--r--srfi/plist-impl.scm29
-rw-r--r--srfi/srfi-125-impl.scm58
-rw-r--r--srfi/srfi-126-impl.scm54
-rw-r--r--srfi/srfi-146-hash-impl.scm82
-rw-r--r--srfi/srfi-146-impl.scm82
-rw-r--r--srfi/srfi-69-impl.scm42
14 files changed, 544 insertions, 499 deletions
diff --git a/srfi-225-test.scm b/srfi-225-test.scm
index 22c3df1..b85297c 100644
--- a/srfi-225-test.scm
+++ b/srfi-225-test.scm
@@ -21,7 +21,7 @@
;; which counts how often each dtd's method was called
;; verify that all functions were tested
(define (wrap-dtd dtd)
- (define proc-count (+ 1 dict-comparator-index))
+ (define proc-count (+ 1 dict-comparator-id))
(define counter (make-vector proc-count 0))
(define wrapper-dtd-args
(let loop ((indexes (iota proc-count))
@@ -40,7 +40,7 @@
(apply make-dtd wrapper-dtd-args)
counter))
-(define (do-test real-dtd alist->dict comparator test-get-comparator)
+(define (do-test real-dtd alist->dict comparator)
(define dtd real-dtd)
@@ -54,6 +54,17 @@
(test-assert (dict-empty? dtd dict)))
(test-group
+ "dict-unfold"
+ (define (stop? value) (> value 1))
+ (define seed 0)
+ (define (mapper seed) (values (number->string seed) seed))
+ (define (successor seed) (+ 1 seed))
+ (define dict (dict-unfold dtd comparator stop? mapper successor seed))
+ (test-equal 2 (dict-size dtd dict))
+ (test-equal 0 (dict-ref dtd dict "0"))
+ (test-equal 1 (dict-ref dtd dict "1")))
+
+ (test-group
"dictionary?"
(test-assert (not (dictionary? dtd 'foo)))
(test-assert (dictionary? dtd (alist->dict '())))
@@ -469,7 +480,6 @@
"dict-copy"
(define original-dict (alist->dict '((a . b))))
(define copied-dict (dict-copy dtd original-dict))
- ;(test-assert (not (eq? original-dict copied-dict))) ;
(set! original-dict (dict-set! dtd original-dict 'c 'd))
(test-equal 'd (dict-ref dtd original-dict 'c))
(test-equal #f (dict-ref/default dtd copied-dict 'c #f)))
@@ -606,15 +616,14 @@
"dict-comparator"
;; extremelly basic generic test; more useful specific tests defined separately
;; for each dtd
- (when test-get-comparator
- (test-assert (comparator? (dict-comparator dtd (alist->dict '((a . b))))))))
+ (let ((cmp (dict-comparator dtd (alist->dict '((a . b))))))
+ (test-assert (or (not cmp)
+ (comparator? cmp)))))
;; check all procs were called
(for-each
(lambda (index)
- (when (and (= 0 (vector-ref counter index))
- (or test-get-comparator
- (not (= index dict-comparator-index))))
+ (when (= 0 (vector-ref counter index))
(error "Untested procedure" index)))
(iota (vector-length counter))))
@@ -626,18 +635,17 @@
(define alist-dtd (make-alist-dtd equal?))
(define minimal-alist-dtd
(make-dtd
- make-dictionary-index (dtd-ref alist-dtd make-dictionary-index)
- dictionary?-index (dtd-ref alist-dtd dictionary?-index)
- dict-size-index (dtd-ref alist-dtd dict-size-index)
- dict-search-index (dtd-ref alist-dtd dict-search-index)
- dict-search!-index (dtd-ref alist-dtd dict-search!-index)
- dict-for-each-index (dtd-ref alist-dtd dict-for-each-index)
- dict-comparator-index (dtd-ref alist-dtd dict-comparator-index)))
+ make-dictionary-id (dtd-ref alist-dtd make-dictionary-id)
+ dictionary?-id (dtd-ref alist-dtd dictionary?-id)
+ dict-size-id (dtd-ref alist-dtd dict-size-id)
+ dict-search-id (dtd-ref alist-dtd dict-search-id)
+ dict-search!-id (dtd-ref alist-dtd dict-search!-id)
+ dict-for-each-id (dtd-ref alist-dtd dict-for-each-id)
+ dict-comparator-id (dtd-ref alist-dtd dict-comparator-id)))
(do-test
minimal-alist-dtd
alist-copy
- #f
- #t))
+ #f))
(test-group
"alist"
@@ -646,13 +654,11 @@
;; copy to a mutable list instead of using identity function
;; so that mutating procedures don't fail
alist-copy
- #f
- #t)
+ #f)
(test-group
"alist dict-comparator"
- (test-assert (eq? eqv? (comparator-equality-predicate (dict-comparator alist-eqv-dtd '()))))
- (test-assert (eq? equal? (comparator-equality-predicate (dict-comparator alist-equal-dtd '()))))))
+ (test-assert (not (dict-comparator alist-equal-dtd '())))))
(test-group
"plist"
@@ -663,13 +669,10 @@
(map (lambda (pair)
(list (car pair) (cdr pair)))
alist)))
- #f
- #t)
+ #f)
(test-group
"plist dict-comparator"
- (define cmp (dict-comparator plist-dtd '()))
- (test-assert (eq? symbol? (comparator-type-test-predicate cmp)))
- (test-assert (eq? equal? (comparator-equality-predicate cmp)))))
+ (test-assert (not (dict-comparator plist-dtd '())))))
(test-group
"srfi-69"
@@ -682,8 +685,7 @@
(t69:hash-table-set! table (car pair) (cdr pair)))
alist)
table)
- (make-default-comparator)
- #t))
+ (make-default-comparator)))
(test-group
"srfi-125"
@@ -696,8 +698,7 @@
(t125:hash-table-set! table (car pair) (cdr pair)))
alist)
table)
- (make-default-comparator)
- #t))
+ (make-default-comparator)))
(test-group
"srfi-126 (r6rs)"
@@ -710,8 +711,7 @@
(t126:hashtable-set! table (car pair) (cdr pair)))
alist)
table)
- (make-default-comparator)
- #f))
+ (make-default-comparator)))
(test-group
"srfi-146"
@@ -725,8 +725,7 @@
table
(loop (mapping-set! table (caar entries) (cdar entries))
(cdr entries)))))
- cmp
- #t)
+ cmp)
(test-group
"srfi-146 dict-comparator"
(test-equal cmp (dict-comparator mapping-dtd (make-dictionary mapping-dtd cmp)))))
@@ -743,8 +742,7 @@
table
(loop (hashmap-set! table (caar entries) (cdar entries))
(cdr entries)))))
- cmp
- #t)
+ cmp)
(test-group
"srfi-146 hash dict-comparator"
(test-equal cmp (dict-comparator hash-mapping-dtd (make-dictionary hash-mapping-dtd cmp)))))
diff --git a/srfi-225.html b/srfi-225.html
index 3ff98c6..ce5aba4 100644
--- a/srfi-225.html
+++ b/srfi-225.html
@@ -34,7 +34,22 @@ of the object is. Such an object is called a <em>dictionary</em> in this SRFI.<
<h2 id="issues">Issues</h2>
-None at present.
+
+
+<p>dict=?, dict&lt;?, etc. Compare dictionaries for equality, subset, etc.
+A value comparator is passed in.</p>
+
+<p>dict-union(!), dict-intersection(!), dict-difference(!), dict-xor(!).</p>
+
+<p>dict-range=(!), dict-range<(!), etc. Return subsets whose keys are =, &lt;, etc.
+of a provided value.</p>
+
+<p>dict-open-mapping, dict-closed mapping, dict-open-closed-mapping, dict-closed-open-mapping.
+Returns subsets whose keys are in a certain interval specified by upper and lower bounds.</p>
+
+<p>dict-min-key, dict-max-key: Returns the smallest and largest key in the dictionary.</p>
+
+<p>dict-key-successor, dict-key-predecessor: Return preceding and following key.</p>
<h2 id="rationale">Rationale</h2>
@@ -53,7 +68,7 @@ Two dictionaries are <i>similar</i> if they are of the same type and have the sa
<p>Lists are supported as dictionaries using the specification in this section. If two keys are the same (in the sense of the specified equality predicate), then all but the first are treated as if they did not exist.</p>
<p>If <code>plist-dtd</code> (see below) is used with a list, then the list is assumed to be a property list, alternating symbol keys with values. The linear-update mutation operations actually mutate the property list whenever possible. The equality predicate of this type of dictionary is <code>eq?</code>.</p>
<p>If a list is empty or its car is a pair, then the list can be treated as an alist. New values are added to the beginning of an alist and the new alist is returned; linear-update operations do not mutate the alist, but return an alist that may or may not share storage with the original alist. If an association has been updated, then both the new and the old association may be processed by the whole-dictionary procedures. The examples in this SRFI use alists.</p>
-<p>However, an alist (unlike a hashtable or mapping) does not know which equality predicate its users intend to use on it. Therefore, rather than exporting a single DTD for alists, this SRFI provides a procedure <code>make-alist-dtd</code> that takes an equality predicate and returns a DTD specialized for manipulation of alists using that predicate.</p>
+<p>However, an alist (unlike a hashtable or mapping) does not know which equality predicate its users intend to use on it. Therefore, rather than exporting a single DTD for all alists, this SRFI provides a procedure <code>make-alist-dtd</code> that takes an equality predicate and returns a DTD specialized for manipulation of alists using that predicate.</p>
<p>In all other cases, lists cannot be treated as dictionaries unless a DTD exists.</p>
<h3>Procedures</h3>
<p>Each of the following examples is assumed to be prefixed by the following definitions:</p>
@@ -65,9 +80,19 @@ Consequently, previous examples don't affect later ones.
<h3 id="constructor">Constructor</h3>
<p><code>(make-dictionary</code>&nbsp;<em>dtd comparator</em><code>)</code></p>
<p>Returns an empty dictionary of the type described by the DTD using <em>comparator</em> to specify the dictionary's equality predicate and its ordering predicate and/or hash function.</p>
-<p>If the contents of <em>comparator</em> are inconsistent with the dictionary type, an error satisfying
-<code>dictionary-error?</code> is signaled.
+<p>If the contents of <em>comparator</em> are inconsistent with the dictionary type, it is an error.
If the dictionary type does not accept a comparator, <code>#f</code> should be passed instead.</p>
+<p><code>(dict-unfold</code>&nbsp;<em>dtd comparator stop? mapper successor seed</em><code>)</code></p>
+<p>
+Create a new dictionary as if by <code>make-dictionary</code> using
+<em>dtd</em> and <em>comparator</em>. If the result of applying
+the predicate <em>stop?</em> to <em>seed</em> is true, return the dictionary.
+Otherwise, apply the procedure <em>mapper</em> to <em>seed</em>.
+<em>Mapper</em> returns two values, which are inserted into the dictionary
+as the key and the value respectively. Then get a new seed by
+applying the procedure <em>successor</em> to <em>seed</em>, and repeat
+this algorithm.
+</p>
<h3 id="predicates">Predicates</h3>
<p><code>(dictionary?</code>&nbsp;<em>dtd obj</em><code>)</code></p>
<p>Returns <code>#t</code> if <em>obj</em> answers <code>#t</code> to the type predicate stored in the DTD, and <code>#f</code> otherwise.</p>
@@ -131,11 +156,7 @@ Otherwise, returns two values, a dictionary that contains all the associations o
<code>(dict-update!</code>&nbsp;<em>dtd dictionary key updater</em> [<em>failure</em> [<em>success</em>] ]<code>)</code></p>
<p>Retrieves the value of <em>key</em> as if by <code>dict-ref</code>, invokes <em>updater</em> on it, and sets the value of <em>key</em> to be the result of calling <em>updater</em> as if by <code>dict-set</code>, but may do so more efficiently. Returns the updated dictionary. The default value of <em>failure</em> signals an error; the default value of <em>success</em> is the identity procedure.</p>
<code>(dict-update/default</code>&nbsp;<em>dtd dictionary key updater default</em><code>)</code><br>
-<<<<<<< HEAD
<code>(dict-update/default!</code>&nbsp;<em>dtd dictionary key updater default</em><code>)</code></p>
-=======
-<code>(dict-update/default!</code>&nbsp;<em>dtd dictionary key updater default</em><code>)</code>
->>>>>>> ffd17d798ba88943d709a266e7478507f96349ab
<p>Retrieves the value of <em>key</em> as if by <code>dict-ref/default</code>, invokes <em>updater</em> on it, and sets the value of <em>key</em> to be the result of calling <em>updater</em> as if by <code>dict-set</code>, but may do so more efficiently. Returns the updated dictionary.</p>
<p><code>(dict-pop</code>&nbsp;<em>dtd dictionary</em><code>)</code><br>
<code>(dict-pop!</code>&nbsp;<em>dtd dictionary</em><code>)</code></p>
@@ -272,51 +293,54 @@ and <code>dict-search</code>.
</p>
<p><code>(dict-comparator</code>&nbsp;<em>dtd dictionary</em><code>)</code></p>
<p>Return a comparator representing the type predicate, equality predicate, ordering predicate, and hash function of <em>dict</em>. The last two may be <code>#f</code> if the dictionary does not make use of these functions.</p>
+<p>If no comparator is relative to the dictionary type, returns <code>#f</code>.</p>
<h3 id="dictionary-type-descriptors">Dictionary type descriptors</h3>
<p><code>(dtd?</code>&nbsp;<em>obj</em><code>)</code></p>
<p>Returns <code>#t</code> if <em>obj</em> is a DTD, and <code>#f</code> otherwise.</p>
<p><code>(make-dtd</code>&nbsp;<em>arg</em> …<code>)</code><br>
-<code>(dtd</code>&nbsp;(<em>procindex proc</em>) …<code>)</code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[syntax]</p>
-<p>Returns a new dictionary type providing procedures that allow manipulation of dictionaries of that type. The <em>args</em> are alternately <em>procindex</em> names and corresponding <em>procs</em>.</p>
-<p>A <em>procindex</em> argument is the value of a variable whose name is the same as a procedure (except those in this section and the Exceptions section) suffixed with <code>-index</code> is the same as one of the procedures defined in this SRFI (other than those in this section), and a <em>proc</em> argument is the specific procedure implementing it for this type. These procedures only need to handle a full-length argument list (except when defining <code>dict-ref</code> and <code>dict-update!</code>), as the other defaults have already been supplied by the framework.</p>
+<code>(dtd</code>&nbsp;(<em>proc-id proc</em>) …<code>)</code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[syntax]</p>
+<p>Returns a new dictionary type providing procedures that allow manipulation of dictionaries of that type. The <em>args</em> are alternately <em>proc-ids</em> and corresponding <em>procs</em>.</p>
+<p>A <em>proc-id</em> argument is the value of a variable whose name is the same as a procedure (except those in this section and the Exceptions section) suffixed with <code>-id</code>, and a <em>proc</em> argument is the specific procedure implementing it for this type. These procedures only need to handle a full-length argument list (except when defining <code>dict-ref</code> and <code>dict-update!</code>), as the other defaults have already been supplied by the framework.</p>
+<p><b>FIXME: Is the parenthesized part still true?</b></p>
<p>
Arguments for the six procedures <code>make-dictionary</code>, <code>dictionary?</code>, <code>dict-size</code>, <code>dict-search</code>, <code>dict-search!</code>, and <code>dict-for-each</code> are needed to make a fully functional DTD, but it is not an error to omit them. The others are optional, but if provided can be more efficient than the versions automatically provided by the implementation of this SRFI.</p>
-<p>The <code>dtd</code> macro behaves like a wrapper around <code>make-dtd</code>, but may also verify that the <em>procindex</em> names are valid, that there are no duplicates, etc.</p>
+<p>The <code>dtd</code> macro behaves like a wrapper around <code>make-dtd</code>, but may also verify that the <em>proc-ids</em> are valid, that there are no duplicates, etc.</p>
<p>The following examples are from the file <code>plist-impl.scm</code>
in the sample implementation; the procedures referred to are also in
that file.<p>
<blockquote><pre>
(make-dtd
- make-dictionary-index make-plist
- dictionary?-index plist?
- dict-map-index plist-map
- dict-map!-index plist-map!
- dict-filter-index plist-filter
- dict-filter!-index plist-filter!
- dict-search-index plist-search
- dict-search!-index plist-search!
- dict-copy-index plist-copy
- dict-size-index plist-size
- dict-for-each-index plist-foreach
- dict-comparator-index plist-comparator)) =&gt; a DTD for plists
+ make-dictionary-id make-plist
+ dictionary?-id plist?
+ dict-map-id plist-map
+ dict-map!-id plist-map!
+ dict-filter-id plist-filter
+ dict-filter!-id plist-filter!
+ dict-search-id plist-search
+ dict-search!-id plist-search!
+ dict-copy-id plist-copy
+ dict-size-id plist-size
+ dict-for-each-id plist-foreach
+ dict-comparator-id plist-comparator)) =&gt; a DTD for plists
(dtd
- (make-dictionary-index make-plist)
- (dictionary?-index plist?)
- (dict-map-index plist-map)
- (dict-map!-index plist-map!)
- (dict-filter-index plist-filter)
- (dict-filter!-index plist-filter!)
- (dict-search-index plist-search)
- (dict-search!-index plist-search!)
- (dict-copy-index plist-copy)
- (dict-size-index plist-size)
- (dict-for-each-index plist-foreach)
- (dict-comparator-index plist-comparator)) =&gt; a DTD for plists
+ (make-dictionary-id make-plist)
+ (dictionary?-id plist?)
+ (dict-map-id plist-map)
+ (dict-map!-id plist-map!)
+ (dict-filter-id plist-filter)
+ (dict-filter!-id plist-filter!)
+ (dict-search-id plist-search)
+ (dict-search!-id plist-search!)
+ (dict-copy-id plist-copy)
+ (dict-size-id plist-size)
+ (dict-for-each-id plist-foreach)
+ (dict-comparator-id plist-comparator)) =&gt; a DTD for plists
</pre></blockquote>
-<p><code>(make-modified-dtd</code>&nbsp;<em>dtd obj</em> ...<code>)</code></p>
+<p><code>(make-modified-dtd</code>&nbsp;<em>dtd obj</em> ...<code>)</code><br>
+<code>(modified-dtd</code>&nbsp;<em>dtd</em> <code>(</code><em>proc-id proc</em><code>)</code> ...<code>)</code> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[syntax]</p>
<p>Returns a DTD that is equivalent to <em>dtd</em>
-except that the alternating <em>procindexes</em> and <em>procs</em>
+except that the alternating <em>proc-ids</em> and <em>procs</em>
are used to replace the corresponding entries in <em>dtd</em>.
Caution should be used when replacing any procedure
other than the six listed in the definition of <code>make-dtd</code>.</p>
@@ -326,15 +350,21 @@ arguments to the underlying dictionary-type-specific constructor.
(<code>make-hash-table</code>, e.g.)</p>
<blockquote><pre>
(make-modified-dtd hash-table-dtd
- make-dictionary-index
+ make-dictionary-id
(lambda (dtd comparator)
(make-hash-table comparator 'weak-keys))) =&gt;
- a DTD for weak hash tables</pre></blockquote>
+ a DTD for weak hash tables</code></blockquote>
+<blockquote><pre>
+(modified-dtd hash-table-dtd
+ (make-dictionary-id
+ (lambda (dtd comparator)
+ (make-hash-table comparator 'weak-keys)))) =&gt;
+ a DTD for weak hash tables</code></blockquote>
<p><code>(make-alist-dtd</code>&nbsp;<em>equal</em><code>)</code></p>
<p>Returns a DTD for manipulating an alist using the equality predicate <em>equal</em>.</p>
<blockquote><code>(make-alist-dtd =) =&gt; a DTD for alists using numeric equality</code></blockquote>
-<p><code>(dtd-ref</code>&nbsp;<em>dtd procindex</em><code>)</code></p>
-<p>Returns the procedure designated by <em>procindex</em> from <em>dtd</em>.
+<p><code>(dtd-ref</code>&nbsp;<em>dtd proc-id</em><code>)</code></p>
+<p>Returns the procedure designated by <em>proc-id</em> from <em>dtd</em>.
This allows the ability to call a particular DTD procedure more efficiently multiple times.</p>
<h3 id="exceptions">Exceptions</h3>
<p><code>(dictionary-error</code>&nbsp;<em>message irritant</em> ... <code>)</code></p>
@@ -350,37 +380,49 @@ and <code>#f</code> otherwise.
<p><code>(dictionary-irritants</code>&nbsp;<em>dictionary-error</em><code>)</code></p>
<p>Returns a list of the irritants associated with <em>dictionary-error</em>.</p>
<h3 id="variables">Variables</h3>
-<p>The following procindex variables are exported from this DTD:
-<code>make-dictionary-index</code>,
-<code>dictionary?-index</code>,
-<code>dict-empty?-index</code>,
-<code>dict-contains?-index</code>,
-<code>dict-ref-index</code>,
-<code>dict-ref/default-index</code>,
-<code>dict-set-index</code>,
-<code>dict-adjoin-index</code>,
-<code>dict-delete-index</code>,
-<code>dict-delete-all-index</code>,
-<code>dict-replace-index</code>,
-<code>dict-update-index</code>,
-<code>dict-update/default-index</code>,
-<code>dict-pop-index</code>,
-<code>dict-map-index</code>,
-<code>dict-filter-index</code>,
-<code>dict-remove-index</code>,
-<code>dict-search-index</code>,
-<code>dict-copy-index</code>,
-<code>dict-size-index</code>,
-<code>dict-count-index</code>,
-<code>dict-any-index</code>,
-<code>dict-every-index</code>,
-<code>dict-keys-index</code>,
-<code>dict-values-index</code>,
-<code>dict-entries-index</code>,
-<code>dict-fold-index</code>,
-<code>dict-map-&gt;list-index</code>,
-<code>dict-dict-&gt;alist-index</code>,
-<code>dict-comparator-index</code>.
+<p>The following proc-id variables are exported from this DTD:
+<code>make-dictionary-id</code>,
+<code>dict-unfold</code>,
+<code>dictionary?-id</code>,
+<code>dict-empty?-id</code>,
+<code>dict-contains?-id</code>,
+<code>dict-ref-id</code>,
+<code>dict-ref/default-id</code>,
+<code>dict-set-id</code>,
+<code>dict-adjoin-id</code>,
+<code>dict-adjoin!-id</code>,
+<code>dict-delete-id</code>,
+<code>dict-delete!-id</code>,
+<code>dict-delete-all-id</code>,
+<code>dict-delete-all!-id</code>,
+<code>dict-replace-id</code>,
+<code>dict-replace!-id</code>,
+<code>dict-update-id</code>,
+<code>dict-update!-id</code>,
+<code>dict-update/default-id</code>,
+<code>dict-update/default!-id</code>,
+<code>dict-pop-id</code>,
+<code>dict-pop!-id</code>,
+<code>dict-map-id</code>,
+<code>dict-map!-id</code>,
+<code>dict-filter-id</code>,
+<code>dict-filter!-id</code>,
+<code>dict-remove-id</code>,
+<code>dict-remove!-id</code>,
+<code>dict-search-id</code>,
+<code>dict-search!-id</code>,
+<code>dict-copy-id</code>,
+<code>dict-size-id</code>,
+<code>dict-count-id</code>,
+<code>dict-any-id</code>,
+<code>dict-every-id</code>,
+<code>dict-keys-id</code>,
+<code>dict-values-id</code>,
+<code>dict-entries-id</code>,
+<code>dict-fold-id</code>,
+<code>dict-map-&gt;list-id</code>,
+<code>dict-dict-&gt;alist-id</code>,
+<code>dict-comparator-id</code>.
<p>The following DTDs are also exported from this SRFI:
<code>srfi-69-dtd</code>, <code>hash-table-dtd</code>, <code>srfi-126-dtd</code>,
<code>mapping-dtd</code>, <code>hash-mapping-dtd</code>, <code>plist-dtd</code>,
@@ -394,6 +436,7 @@ and <code>equal?</code> respectively.</p>
new dictionary types that may not have complete dictionary APIs:</p>
<ul>
+<li><code>dict-unfold</code> depends on <code>make-dictionary</code> and <code>dict-set!</code></li>
<li><code>dict-empty?</code> depends on <code>dict-size</code></li>
<li><code>dict-contains?</code> depends on <code>dict-ref</code></li>
<li><code>dict-ref</code> depends on <code>dict-search</code></li>
diff --git a/srfi/225.scm b/srfi/225.scm
deleted file mode 120000
index 74d5e72..0000000
--- a/srfi/225.scm
+++ /dev/null
@@ -1 +0,0 @@
-225.sld \ No newline at end of file
diff --git a/srfi/225.sld b/srfi/225.sld
index 53bc68f..f44f3ab 100644
--- a/srfi/225.sld
+++ b/srfi/225.sld
@@ -15,6 +15,7 @@
;; constructor
make-dictionary
+ dict-unfold
;; predicates
dictionary?
@@ -82,51 +83,52 @@
dictionary-irritants
;; proc indeces
- make-dictionary-index
- dictionary?-index
- dict-empty?-index
- dict-contains?-index
- dict-ref-index
- dict-ref/default-index
- dict-set-index
- dict-set!-index
- dict-adjoin-index
- dict-adjoin!-index
- dict-delete-index
- dict-delete!-index
- dict-delete-all-index
- dict-delete-all!-index
- dict-replace-index
- dict-replace!-index
- dict-intern-index
- dict-intern!-index
- dict-update-index
- dict-update!-index
- dict-update/default-index
- dict-update/default!-index
- dict-pop-index
- dict-pop!-index
- dict-map-index
- dict-map!-index
- dict-filter-index
- dict-filter!-index
- dict-remove-index
- dict-remove!-index
- dict-search-index
- dict-search!-index
- dict-copy-index
- dict-size-index
- dict-for-each-index
- dict-count-index
- dict-any-index
- dict-every-index
- dict-keys-index
- dict-values-index
- dict-entries-index
- dict-fold-index
- dict-map->list-index
- dict->alist-index
- dict-comparator-index
+ make-dictionary-id
+ dict-unfold-id
+ dictionary?-id
+ dict-empty?-id
+ dict-contains?-id
+ dict-ref-id
+ dict-ref/default-id
+ dict-set-id
+ dict-set!-id
+ dict-adjoin-id
+ dict-adjoin!-id
+ dict-delete-id
+ dict-delete!-id
+ dict-delete-all-id
+ dict-delete-all!-id
+ dict-replace-id
+ dict-replace!-id
+ dict-intern-id
+ dict-intern!-id
+ dict-update-id
+ dict-update!-id
+ dict-update/default-id
+ dict-update/default!-id
+ dict-pop-id
+ dict-pop!-id
+ dict-map-id
+ dict-map!-id
+ dict-filter-id
+ dict-filter!-id
+ dict-remove-id
+ dict-remove!-id
+ dict-search-id
+ dict-search!-id
+ dict-copy-id
+ dict-size-id
+ dict-for-each-id
+ dict-count-id
+ dict-any-id
+ dict-every-id
+ dict-keys-id
+ dict-values-id
+ dict-entries-id
+ dict-fold-id
+ dict-map->list-id
+ dict->alist-id
+ dict-comparator-id
;; basic DTDs
plist-dtd
diff --git a/srfi/alist-impl.scm b/srfi/alist-impl.scm
index e64dc97..59fac7b 100644
--- a/srfi/alist-impl.scm
+++ b/srfi/alist-impl.scm
@@ -106,25 +106,22 @@
(alist-copy dtd alist))
(define (alist-comparator dtd dictionary)
- (make-comparator (lambda args #t)
- key=
- #f
- #f))
+ #f)
(make-dtd
- make-dictionary-index make-alist
- dictionary?-index alist?
- dict-map-index alist-map
- dict-map!-index alist-map!
- dict-filter-index alist-filter
- dict-filter!-index alist-filter!
- dict-search-index alist-search
- dict-search!-index alist-search!
- dict-size-index alist-size
- dict-for-each-index alist-foreach
- dict->alist-index alist->alist
- dict-comparator-index alist-comparator
- dict-copy-index alist-copy))
+ make-dictionary-id make-alist
+ dictionary?-id alist?
+ dict-map-id alist-map
+ dict-map!-id alist-map!
+ dict-filter-id alist-filter
+ dict-filter!-id alist-filter!
+ dict-search-id alist-search
+ dict-search!-id alist-search!
+ dict-size-id alist-size
+ dict-for-each-id alist-foreach
+ dict->alist-id alist->alist
+ dict-comparator-id alist-comparator
+ dict-copy-id alist-copy))
(define alist-eqv-dtd (make-alist-dtd eqv?))
(define alist-equal-dtd (make-alist-dtd equal?))
diff --git a/srfi/default-impl.scm b/srfi/default-impl.scm
index dfd3f58..2be8c98 100644
--- a/srfi/default-impl.scm
+++ b/srfi/default-impl.scm
@@ -15,6 +15,17 @@
(define default-dict-search! (not-implemented "dict-search!"))
(define default-dict-for-each (not-implemented "dict-for-each"))
+ (define (default-dict-unfold dtd comparator stop? mapper successor seed)
+ (let loop ((dict (make-dictionary dtd comparator))
+ (seed seed))
+ (if (stop? seed)
+ dict
+ (let ()
+ (define-values (key value) (mapper seed))
+ (define new-seed (successor seed))
+ (loop (dict-set! dtd dict key value)
+ new-seed)))))
+
(define (default-dict-empty? dtd dictionary)
(= 0 (dict-size dtd dictionary)))
@@ -218,17 +229,8 @@
(define (default-dict-remove! dtd pred dictionary)
(default-dict-remove* dtd dict-filter! pred dictionary))
- (define (create-fresh-dict-from-existing dtd dictionary)
- (call/cc
- (lambda (k)
- (with-exception-handler
- (lambda (err)
- (k (make-dictionary dtd #f)))
- (lambda ()
- (make-dictionary dtd (dict-comparator dictionary)))))))
-
(define (default-dict-copy dtd dictionary)
- (define dict (create-fresh-dict-from-existing dtd dictionary))
+ (define dict (make-dictionary dtd (dict-comparator dtd dictionary)))
(dict-for-each dtd
(lambda (key value)
(set! dict (dict-set! dtd dict key value)))
@@ -324,51 +326,52 @@
(define default-dtd
(make-modified-dtd
null-dtd
- make-dictionary-index default-make-dictionary
- dictionary?-index default-dictionary?
- dict-empty?-index default-dict-empty?
- dict-contains?-index default-dict-contains?
- dict-ref-index default-dict-ref
- dict-ref/default-index default-dict-ref/default
- dict-set-index default-dict-set
- dict-set!-index default-dict-set!
- dict-adjoin-index default-dict-adjoin
- dict-adjoin!-index default-dict-adjoin!
- dict-delete-index default-dict-delete
- dict-delete!-index default-dict-delete!
- dict-delete-all-index default-dict-delete-all
- dict-delete-all!-index default-dict-delete-all!
- dict-replace-index default-dict-replace
- dict-replace!-index default-dict-replace!
- dict-intern-index default-dict-intern
- dict-intern!-index default-dict-intern!
- dict-update-index default-dict-update
- dict-update!-index default-dict-update!
- dict-update/default-index default-dict-update/default
- dict-update/default!-index default-dict-update/default!
- dict-pop-index default-dict-pop
- dict-pop!-index default-dict-pop!
- dict-map-index default-dict-map
- dict-map!-index default-dict-map!
- dict-filter-index default-dict-filter
- dict-filter!-index default-dict-filter!
- dict-remove-index default-dict-remove
- dict-remove!-index default-dict-remove!
- dict-search-index default-dict-search
- dict-search!-index default-dict-search!
- dict-copy-index default-dict-copy
- dict-size-index default-dict-size
- dict-for-each-index default-dict-for-each
- dict-count-index default-dict-count
- dict-any-index default-dict-any
- dict-every-index default-dict-every
- dict-keys-index default-dict-keys
- dict-values-index default-dict-values
- dict-entries-index default-dict-entries
- dict-fold-index default-dict-fold
- dict-map->list-index default-dict-map->list
- dict->alist-index default-dict->alist
- dict-comparator-index default-dict-comparator))
+ make-dictionary-id default-make-dictionary
+ dict-unfold-id default-dict-unfold
+ dictionary?-id default-dictionary?
+ dict-empty?-id default-dict-empty?
+ dict-contains?-id default-dict-contains?
+ dict-ref-id default-dict-ref
+ dict-ref/default-id default-dict-ref/default
+ dict-set-id default-dict-set
+ dict-set!-id default-dict-set!
+ dict-adjoin-id default-dict-adjoin
+ dict-adjoin!-id default-dict-adjoin!
+ dict-delete-id default-dict-delete
+ dict-delete!-id default-dict-delete!
+ dict-delete-all-id default-dict-delete-all
+ dict-delete-all!-id default-dict-delete-all!
+ dict-replace-id default-dict-replace
+ dict-replace!-id default-dict-replace!
+ dict-intern-id default-dict-intern
+ dict-intern!-id default-dict-intern!
+ dict-update-id default-dict-update
+ dict-update!-id default-dict-update!
+ dict-update/default-id default-dict-update/default
+ dict-update/default!-id default-dict-update/default!
+ dict-pop-id default-dict-pop
+ dict-pop!-id default-dict-pop!
+ dict-map-id default-dict-map
+ dict-map!-id default-dict-map!
+ dict-filter-id default-dict-filter
+ dict-filter!-id default-dict-filter!
+ dict-remove-id default-dict-remove
+ dict-remove!-id default-dict-remove!
+ dict-search-id default-dict-search
+ dict-search!-id default-dict-search!
+ dict-copy-id default-dict-copy
+ dict-size-id default-dict-size
+ dict-for-each-id default-dict-for-each
+ dict-count-id default-dict-count
+ dict-any-id default-dict-any
+ dict-every-id default-dict-every
+ dict-keys-id default-dict-keys
+ dict-values-id default-dict-values
+ dict-entries-id default-dict-entries
+ dict-fold-id default-dict-fold
+ dict-map->list-id default-dict-map->list
+ dict->alist-id default-dict->alist
+ dict-comparator-id default-dict-comparator))
;; sanity check
(vector-for-each
diff --git a/srfi/externals.scm b/srfi/externals.scm
index 34c8450..14c5a4d 100644
--- a/srfi/externals.scm
+++ b/srfi/externals.scm
@@ -24,10 +24,11 @@
(assume (dtd? dtd))
(apply (dtd-ref-stx dtd index) dtd args)))))
-(define/dict-proc make-dictionary make-dictionary-index)
-(define/dict-proc dictionary? dictionary?-index)
-(define/dict-proc dict-empty? dict-empty?-index)
-(define/dict-proc dict-contains? dict-contains?-index)
+(define/dict-proc make-dictionary make-dictionary-id)
+(define/dict-proc dict-unfold dict-unfold-id)
+(define/dict-proc dictionary? dictionary?-id)
+(define/dict-proc dict-empty? dict-empty?-id)
+(define/dict-proc dict-contains? dict-contains?-id)
(define dict-ref
(case-lambda
@@ -41,21 +42,21 @@
((dtd dict key failure success)
(assume (dtd? dtd))
- ((dtd-ref-stx dtd dict-ref-index) dtd dict key failure success))))
-
-(define/dict-proc dict-ref/default dict-ref/default-index)
-(define/dict-proc dict-set dict-set-index)
-(define/dict-proc dict-set! dict-set!-index)
-(define/dict-proc dict-adjoin dict-adjoin-index)
-(define/dict-proc dict-adjoin! dict-adjoin!-index)
-(define/dict-proc dict-delete dict-delete-index)
-(define/dict-proc dict-delete! dict-delete!-index)
-(define/dict-proc dict-delete-all dict-delete-all-index)
-(define/dict-proc dict-delete-all! dict-delete-all!-index)
-(define/dict-proc dict-replace dict-replace-index)
-(define/dict-proc dict-replace! dict-replace!-index)
-(define/dict-proc dict-intern dict-intern-index)
-(define/dict-proc dict-intern! dict-intern!-index)
+ ((dtd-ref-stx dtd dict-ref-id) dtd dict key failure success))))
+
+(define/dict-proc dict-ref/default dict-ref/default-id)
+(define/dict-proc dict-set dict-set-id)
+(define/dict-proc dict-set! dict-set!-id)
+(define/dict-proc dict-adjoin dict-adjoin-id)
+(define/dict-proc dict-adjoin! dict-adjoin!-id)
+(define/dict-proc dict-delete dict-delete-id)
+(define/dict-proc dict-delete! dict-delete!-id)
+(define/dict-proc dict-delete-all dict-delete-all-id)
+(define/dict-proc dict-delete-all! dict-delete-all!-id)
+(define/dict-proc dict-replace dict-replace-id)
+(define/dict-proc dict-replace! dict-replace!-id)
+(define/dict-proc dict-intern dict-intern-id)
+(define/dict-proc dict-intern! dict-intern!-id)
(define dict-update
(case-lambda
@@ -69,7 +70,7 @@
((dtd dict key updater failure success)
(assume (dtd? dtd))
- ((dtd-ref-stx dtd dict-update-index) dtd dict key updater failure success))))
+ ((dtd-ref-stx dtd dict-update-id) dtd dict key updater failure success))))
(define dict-update!
(case-lambda
@@ -83,33 +84,33 @@
((dtd dict key updater failure success)
(assume (dtd? dtd))
- ((dtd-ref-stx dtd dict-update!-index) dtd dict key updater failure success))))
-
-(define/dict-proc dict-update/default dict-update/default-index)
-(define/dict-proc dict-update/default! dict-update/default!-index)
-(define/dict-proc dict-pop dict-pop-index)
-(define/dict-proc dict-pop! dict-pop!-index)
-(define/dict-proc dict-map dict-map-index)
-(define/dict-proc dict-map! dict-map!-index)
-(define/dict-proc dict-filter dict-filter-index)
-(define/dict-proc dict-filter! dict-filter!-index)
-(define/dict-proc dict-remove dict-remove-index)
-(define/dict-proc dict-remove! dict-remove!-index)
-(define/dict-proc dict-search dict-search-index)
-(define/dict-proc dict-search! dict-search!-index)
-(define/dict-proc dict-copy dict-copy-index)
-(define/dict-proc dict-size dict-size-index)
-(define/dict-proc dict-for-each dict-for-each-index)
-(define/dict-proc dict-count dict-count-index)
-(define/dict-proc dict-any dict-any-index)
-(define/dict-proc dict-every dict-every-index)
-(define/dict-proc dict-keys dict-keys-index)
-(define/dict-proc dict-values dict-values-index)
-(define/dict-proc dict-entries dict-entries-index)
-(define/dict-proc dict-fold dict-fold-index)
-(define/dict-proc dict-map->list dict-map->list-index)
-(define/dict-proc dict->alist dict->alist-index)
-(define/dict-proc dict-comparator dict-comparator-index)
+ ((dtd-ref-stx dtd dict-update!-id) dtd dict key updater failure success))))
+
+(define/dict-proc dict-update/default dict-update/default-id)
+(define/dict-proc dict-update/default! dict-update/default!-id)
+(define/dict-proc dict-pop dict-pop-id)
+(define/dict-proc dict-pop! dict-pop!-id)
+(define/dict-proc dict-map dict-map-id)
+(define/dict-proc dict-map! dict-map!-id)
+(define/dict-proc dict-filter dict-filter-id)
+(define/dict-proc dict-filter! dict-filter!-id)
+(define/dict-proc dict-remove dict-remove-id)
+(define/dict-proc dict-remove! dict-remove!-id)
+(define/dict-proc dict-search dict-search-id)
+(define/dict-proc dict-search! dict-search!-id)
+(define/dict-proc dict-copy dict-copy-id)
+(define/dict-proc dict-size dict-size-id)
+(define/dict-proc dict-for-each dict-for-each-id)
+(define/dict-proc dict-count dict-count-id)
+(define/dict-proc dict-any dict-any-id)
+(define/dict-proc dict-every dict-every-id)
+(define/dict-proc dict-keys dict-keys-id)
+(define/dict-proc dict-values dict-values-id)
+(define/dict-proc dict-entries dict-entries-id)
+(define/dict-proc dict-fold dict-fold-id)
+(define/dict-proc dict-map->list dict-map->list-id)
+(define/dict-proc dict->alist dict->alist-id)
+(define/dict-proc dict-comparator dict-comparator-id)
(define (dtd-ref dtd procindex)
(dtd-ref-stx dtd procindex))
@@ -120,11 +121,11 @@
((null? lst))
(when (null? (cdr lst))
(error "Uneven amount of arguments" lst))
- (let ((proc-index (car lst))
+ (let ((proc-id (car lst))
(proc (cadr lst)))
(unless (procedure? proc)
(error "Not a procedure" proc))
- (vector-set! vec proc-index proc)))
+ (vector-set! vec proc-id proc)))
(make-dtd-private vec))
(define (make-dtd . lst)
diff --git a/srfi/indexes.scm b/srfi/indexes.scm
index da99b57..958f5a0 100644
--- a/srfi/indexes.scm
+++ b/srfi/indexes.scm
@@ -1,53 +1,54 @@
;; procedure index definitions
-(define proc-index 0)
-(define (proc-index-inc)
- (define v proc-index)
- (set! proc-index (+ 1 proc-index))
+(define proc-id 0)
+(define (proc-id-inc)
+ (define v proc-id)
+ (set! proc-id (+ 1 proc-id))
v)
-(define make-dictionary-index (proc-index-inc))
-(define dictionary?-index (proc-index-inc))
-(define dict-empty?-index (proc-index-inc))
-(define dict-contains?-index (proc-index-inc))
-(define dict-ref-index (proc-index-inc))
-(define dict-ref/default-index (proc-index-inc))
-(define dict-set-index (proc-index-inc))
-(define dict-set!-index (proc-index-inc))
-(define dict-adjoin-index (proc-index-inc))
-(define dict-adjoin!-index (proc-index-inc))
-(define dict-delete-index (proc-index-inc))
-(define dict-delete!-index (proc-index-inc))
-(define dict-delete-all-index (proc-index-inc))
-(define dict-delete-all!-index (proc-index-inc))
-(define dict-replace-index (proc-index-inc))
-(define dict-replace!-index (proc-index-inc))
-(define dict-intern-index (proc-index-inc))
-(define dict-intern!-index (proc-index-inc))
-(define dict-update-index (proc-index-inc))
-(define dict-update!-index (proc-index-inc))
-(define dict-update/default-index (proc-index-inc))
-(define dict-update/default!-index (proc-index-inc))
-(define dict-pop-index (proc-index-inc))
-(define dict-pop!-index (proc-index-inc))
-(define dict-map-index (proc-index-inc))
-(define dict-map!-index (proc-index-inc))
-(define dict-filter-index (proc-index-inc))
-(define dict-filter!-index (proc-index-inc))
-(define dict-remove-index (proc-index-inc))
-(define dict-remove!-index (proc-index-inc))
-(define dict-search-index (proc-index-inc))
-(define dict-search!-index (proc-index-inc))
-(define dict-copy-index (proc-index-inc))
-(define dict-size-index (proc-index-inc))
-(define dict-for-each-index (proc-index-inc))
-(define dict-count-index (proc-index-inc))
-(define dict-any-index (proc-index-inc))
-(define dict-every-index (proc-index-inc))
-(define dict-keys-index (proc-index-inc))
-(define dict-values-index (proc-index-inc))
-(define dict-entries-index (proc-index-inc))
-(define dict-fold-index (proc-index-inc))
-(define dict-map->list-index (proc-index-inc))
-(define dict->alist-index (proc-index-inc))
-(define dict-comparator-index (proc-index-inc))
-(define dict-procedures-count (proc-index-inc))
+(define make-dictionary-id (proc-id-inc))
+(define dict-unfold-id (proc-id-inc))
+(define dictionary?-id (proc-id-inc))
+(define dict-empty?-id (proc-id-inc))
+(define dict-contains?-id (proc-id-inc))
+(define dict-ref-id (proc-id-inc))
+(define dict-ref/default-id (proc-id-inc))
+(define dict-set-id (proc-id-inc))
+(define dict-set!-id (proc-id-inc))
+(define dict-adjoin-id (proc-id-inc))
+(define dict-adjoin!-id (proc-id-inc))
+(define dict-delete-id (proc-id-inc))
+(define dict-delete!-id (proc-id-inc))
+(define dict-delete-all-id (proc-id-inc))
+(define dict-delete-all!-id (proc-id-inc))
+(define dict-replace-id (proc-id-inc))
+(define dict-replace!-id (proc-id-inc))
+(define dict-intern-id (proc-id-inc))
+(define dict-intern!-id (proc-id-inc))
+(define dict-update-id (proc-id-inc))
+(define dict-update!-id (proc-id-inc))
+(define dict-update/default-id (proc-id-inc))
+(define dict-update/default!-id (proc-id-inc))
+(define dict-pop-id (proc-id-inc))
+(define dict-pop!-id (proc-id-inc))
+(define dict-map-id (proc-id-inc))
+(define dict-map!-id (proc-id-inc))
+(define dict-filter-id (proc-id-inc))
+(define dict-filter!-id (proc-id-inc))
+(define dict-remove-id (proc-id-inc))
+(define dict-remove!-id (proc-id-inc))
+(define dict-search-id (proc-id-inc))
+(define dict-search!-id (proc-id-inc))
+(define dict-copy-id (proc-id-inc))
+(define dict-size-id (proc-id-inc))
+(define dict-for-each-id (proc-id-inc))
+(define dict-count-id (proc-id-inc))
+(define dict-any-id (proc-id-inc))
+(define dict-every-id (proc-id-inc))
+(define dict-keys-id (proc-id-inc))
+(define dict-values-id (proc-id-inc))
+(define dict-entries-id (proc-id-inc))
+(define dict-fold-id (proc-id-inc))
+(define dict-map->list-id (proc-id-inc))
+(define dict->alist-id (proc-id-inc))
+(define dict-comparator-id (proc-id-inc))
+(define dict-procedures-count (proc-id-inc))
diff --git a/srfi/plist-impl.scm b/srfi/plist-impl.scm
index dbec747..e283c8e 100644
--- a/srfi/plist-impl.scm
+++ b/srfi/plist-impl.scm
@@ -103,21 +103,18 @@
(loop (cddr pl))))))
(define (plist-comparator dtd plist)
- (make-comparator symbol?
- equal?
- #f
- #f))
+ #f)
(make-dtd
- make-dictionary-index make-plist
- dictionary?-index plist?
- dict-map-index plist-map
- dict-map!-index plist-map!
- dict-filter-index plist-filter
- dict-filter!-index plist-filter!
- dict-search-index plist-search
- dict-search!-index plist-search!
- dict-copy-index plist-copy
- dict-size-index plist-size
- dict-for-each-index plist-foreach
- dict-comparator-index plist-comparator)))
+ make-dictionary-id make-plist
+ dictionary?-id plist?
+ dict-map-id plist-map
+ dict-map!-id plist-map!
+ dict-filter-id plist-filter
+ dict-filter!-id plist-filter!
+ dict-search-id plist-search
+ dict-search!-id plist-search!
+ dict-copy-id plist-copy
+ dict-size-id plist-size
+ dict-for-each-id plist-foreach
+ dict-comparator-id plist-comparator)))
diff --git a/srfi/srfi-125-impl.scm b/srfi/srfi-125-impl.scm
index 61863b5..d735f95 100644
--- a/srfi/srfi-125-impl.scm
+++ b/srfi/srfi-125-impl.scm
@@ -129,32 +129,32 @@
(t125:hash-table-ref/default table key default))
(make-dtd
- make-dictionary-index t125:make-hash-table*
- dictionary?-index t125:hash-table?*
- dict-empty?-index t125:hash-table-empty?*
- dict-contains?-index t125:hash-table-contains?*
- dict-ref-index t125:hash-table-ref*
- dict-ref/default-index t125:hash-table-ref/default*
- dict-set!-index t125:hash-table-set!*
- dict-delete-all!-index t125:hash-table-delete-all!*
- dict-intern!-index t125:hash-table-intern!*
- dict-update!-index t125:hash-table-update!*
- dict-update/default!-index t125:hash-table-update!/default*
- dict-pop!-index t125:hash-table-pop!*
- dict-map!-index t125:hash-table-map!*
- dict-filter!-index t125:hash-table-filter!*
- dict-filter-index t125:hash-table-filter*
- dict-remove!-index t125:hash-table-remove!*
- dict-remove-index t125:hash-table-remove*
- dict-search!-index t125:hash-table-search!*
- dict-search-index t125:hash-table-search*
- dict-size-index t125:hash-table-size*
- dict-for-each-index t125:hash-table-for-each*
- dict-keys-index t125:hash-table-keys*
- dict-values-index t125:hash-table-values*
- dict-entries-index t125:hash-table-entries*
- dict-fold-index t125:hash-table-fold*
- dict-map->list-index t125:hash-table-map->list*
- dict->alist-index t125:hash-table->alist*
- dict-comparator-index t125:hash-table-comparator*
- dict-copy-index t125:hash-table-copy*)))
+ make-dictionary-id t125:make-hash-table*
+ dictionary?-id t125:hash-table?*
+ dict-empty?-id t125:hash-table-empty?*
+ dict-contains?-id t125:hash-table-contains?*
+ dict-ref-id t125:hash-table-ref*
+ dict-ref/default-id t125:hash-table-ref/default*
+ dict-set!-id t125:hash-table-set!*
+ dict-delete-all!-id t125:hash-table-delete-all!*
+ dict-intern!-id t125:hash-table-intern!*
+ dict-update!-id t125:hash-table-update!*
+ dict-update/default!-id t125:hash-table-update!/default*
+ dict-pop!-id t125:hash-table-pop!*
+ dict-map!-id t125:hash-table-map!*
+ dict-filter!-id t125:hash-table-filter!*
+ dict-filter-id t125:hash-table-filter*
+ dict-remove!-id t125:hash-table-remove!*
+ dict-remove-id t125:hash-table-remove*
+ dict-search!-id t125:hash-table-search!*
+ dict-search-id t125:hash-table-search*
+ dict-size-id t125:hash-table-size*
+ dict-for-each-id t125:hash-table-for-each*
+ dict-keys-id t125:hash-table-keys*
+ dict-values-id t125:hash-table-values*
+ dict-entries-id t125:hash-table-entries*
+ dict-fold-id t125:hash-table-fold*
+ dict-map->list-id t125:hash-table-map->list*
+ dict->alist-id t125:hash-table->alist*
+ dict-comparator-id t125:hash-table-comparator*
+ dict-copy-id t125:hash-table-copy*)))
diff --git a/srfi/srfi-126-impl.scm b/srfi/srfi-126-impl.scm
index 177a835..5e308ba 100644
--- a/srfi/srfi-126-impl.scm
+++ b/srfi/srfi-126-impl.scm
@@ -120,29 +120,33 @@
(define (t126:hashtable-copy* dtd table)
(t126:hashtable-copy table #t))
+ (define (t126:hashtable-comparator* dtd table)
+ #f)
+
(make-dtd
- make-dictionary-index t126:make-hashtable*
- dictionary?-index (prep-dtd-arg t126:hashtable?)
- dict-empty?-index (prep-dtd-arg t126:hashtable-empty?)
- dict-contains?-index (prep-dtd-arg t126:hashtable-contains?)
- dict-ref-index t126:hashtable-ref*
- dict-ref/default-index t126:hashtable-ref/default*
- dict-set!-index t126:hashtable-set!*
- dict-delete-all!-index t126:hashtable-delete-all!*
- dict-intern!-index t126:hashtable-intern!*
- dict-update/default!-index t126:hashtable-update/default!*
- dict-pop!-index t126:hashtable-pop!*
- dict-map!-index t126:hashtable-update-all!*
- dict-filter!-index t126:hashtable-filter!*
- dict-filter-index t126:hashtable-filter*
- dict-remove!-index t126:hashtable-remove!*
- dict-remove-index t126:hashtable-remove*
- dict-search!-index t126:hashtable-search!*
- dict-search-index t126:hashtable-search*
- dict-size-index (prep-dtd-arg t126:hashtable-size)
- dict-for-each-index t126:hashtable-for-each*
- dict-keys-index t126:hashtable-keys*
- dict-values-index t126:hashtable-values*
- dict-entries-index t126:hashtable-entries*
- dict-map->list-index t126:hashtable-map->lset*
- dict-copy-index t126:hashtable-copy*)))
+ make-dictionary-id t126:make-hashtable*
+ dictionary?-id (prep-dtd-arg t126:hashtable?)
+ dict-empty?-id (prep-dtd-arg t126:hashtable-empty?)
+ dict-contains?-id (prep-dtd-arg t126:hashtable-contains?)
+ dict-ref-id t126:hashtable-ref*
+ dict-ref/default-id t126:hashtable-ref/default*
+ dict-set!-id t126:hashtable-set!*
+ dict-delete-all!-id t126:hashtable-delete-all!*
+ dict-intern!-id t126:hashtable-intern!*
+ dict-update/default!-id t126:hashtable-update/default!*
+ dict-pop!-id t126:hashtable-pop!*
+ dict-map!-id t126:hashtable-update-all!*
+ dict-filter!-id t126:hashtable-filter!*
+ dict-filter-id t126:hashtable-filter*
+ dict-remove!-id t126:hashtable-remove!*
+ dict-remove-id t126:hashtable-remove*
+ dict-search!-id t126:hashtable-search!*
+ dict-search-id t126:hashtable-search*
+ dict-size-id (prep-dtd-arg t126:hashtable-size)
+ dict-for-each-id t126:hashtable-for-each*
+ dict-keys-id t126:hashtable-keys*
+ dict-values-id t126:hashtable-values*
+ dict-entries-id t126:hashtable-entries*
+ dict-map->list-id t126:hashtable-map->lset*
+ dict-copy-id t126:hashtable-copy*
+ dict-comparator-id t126:hashtable-comparator*)))
diff --git a/srfi/srfi-146-hash-impl.scm b/srfi/srfi-146-hash-impl.scm
index 8f064dd..40e893f 100644
--- a/srfi/srfi-146-hash-impl.scm
+++ b/srfi/srfi-146-hash-impl.scm
@@ -6,44 +6,44 @@
(apply proc args)))
(make-dtd
- make-dictionary-index (prep-dtd-arg hashmap)
- dictionary?-index (prep-dtd-arg hashmap?)
- dict-empty?-index (prep-dtd-arg hashmap-empty?)
- dict-contains?-index (prep-dtd-arg hashmap-contains?)
- dict-ref-index (prep-dtd-arg hashmap-ref)
- dict-ref/default-index (prep-dtd-arg hashmap-ref/default)
- dict-set-index (prep-dtd-arg hashmap-set)
- dict-set!-index (prep-dtd-arg hashmap-set!)
- dict-adjoin-index (prep-dtd-arg hashmap-adjoin)
- dict-adjoin!-index (prep-dtd-arg hashmap-adjoin!)
- dict-delete-index (prep-dtd-arg hashmap-delete)
- dict-delete!-index (prep-dtd-arg hashmap-delete!)
- dict-delete-all-index (prep-dtd-arg hashmap-delete-all)
- dict-delete-all!-index (prep-dtd-arg hashmap-delete-all!)
- dict-replace-index (prep-dtd-arg hashmap-replace)
- dict-replace!-index (prep-dtd-arg hashmap-replace!)
- dict-intern-index (prep-dtd-arg hashmap-intern)
- dict-intern!-index (prep-dtd-arg hashmap-intern!)
- dict-update-index (prep-dtd-arg hashmap-update)
- dict-update!-index (prep-dtd-arg hashmap-update!)
- dict-update/default-index (prep-dtd-arg hashmap-update/default)
- dict-update/default!-index (prep-dtd-arg hashmap-update!/default)
- dict-pop-index (prep-dtd-arg hashmap-pop)
- dict-pop!-index (prep-dtd-arg hashmap-pop!)
- dict-filter-index (prep-dtd-arg hashmap-filter)
- dict-filter!-index (prep-dtd-arg hashmap-filter!)
- dict-remove-index (prep-dtd-arg hashmap-remove)
- dict-remove!-index (prep-dtd-arg hashmap-remove!)
- dict-search-index (prep-dtd-arg hashmap-search)
- dict-search!-index (prep-dtd-arg hashmap-search!)
- dict-copy-index (prep-dtd-arg hashmap-copy)
- dict-size-index (prep-dtd-arg hashmap-size)
- dict-for-each-index (prep-dtd-arg hashmap-for-each)
- dict-count-index (prep-dtd-arg hashmap-count)
- dict-keys-index (prep-dtd-arg hashmap-keys)
- dict-values-index (prep-dtd-arg hashmap-values)
- dict-entries-index (prep-dtd-arg hashmap-entries)
- dict-fold-index (prep-dtd-arg hashmap-fold)
- dict-map->list-index (prep-dtd-arg hashmap-map->list)
- dict->alist-index (prep-dtd-arg hashmap->alist)
- dict-comparator-index (prep-dtd-arg hashmap-key-comparator))))
+ make-dictionary-id (prep-dtd-arg hashmap)
+ dictionary?-id (prep-dtd-arg hashmap?)
+ dict-empty?-id (prep-dtd-arg hashmap-empty?)
+ dict-contains?-id (prep-dtd-arg hashmap-contains?)
+ dict-ref-id (prep-dtd-arg hashmap-ref)
+ dict-ref/default-id (prep-dtd-arg hashmap-ref/default)
+ dict-set-id (prep-dtd-arg hashmap-set)
+ dict-set!-id (prep-dtd-arg hashmap-set!)
+ dict-adjoin-id (prep-dtd-arg hashmap-adjoin)
+ dict-adjoin!-id (prep-dtd-arg hashmap-adjoin!)
+ dict-delete-id (prep-dtd-arg hashmap-delete)
+ dict-delete!-id (prep-dtd-arg hashmap-delete!)
+ dict-delete-all-id (prep-dtd-arg hashmap-delete-all)
+ dict-delete-all!-id (prep-dtd-arg hashmap-delete-all!)
+ dict-replace-id (prep-dtd-arg hashmap-replace)
+ dict-replace!-id (prep-dtd-arg hashmap-replace!)
+ dict-intern-id (prep-dtd-arg hashmap-intern)
+ dict-intern!-id (prep-dtd-arg hashmap-intern!)
+ dict-update-id (prep-dtd-arg hashmap-update)
+ dict-update!-id (prep-dtd-arg hashmap-update!)
+ dict-update/default-id (prep-dtd-arg hashmap-update/default)
+ dict-update/default!-id (prep-dtd-arg hashmap-update!/default)
+ dict-pop-id (prep-dtd-arg hashmap-pop)
+ dict-pop!-id (prep-dtd-arg hashmap-pop!)
+ dict-filter-id (prep-dtd-arg hashmap-filter)
+ dict-filter!-id (prep-dtd-arg hashmap-filter!)
+ dict-remove-id (prep-dtd-arg hashmap-remove)
+ dict-remove!-id (prep-dtd-arg hashmap-remove!)
+ dict-search-id (prep-dtd-arg hashmap-search)
+ dict-search!-id (prep-dtd-arg hashmap-search!)
+ dict-copy-id (prep-dtd-arg hashmap-copy)
+ dict-size-id (prep-dtd-arg hashmap-size)
+ dict-for-each-id (prep-dtd-arg hashmap-for-each)
+ dict-count-id (prep-dtd-arg hashmap-count)
+ dict-keys-id (prep-dtd-arg hashmap-keys)
+ dict-values-id (prep-dtd-arg hashmap-values)
+ dict-entries-id (prep-dtd-arg hashmap-entries)
+ dict-fold-id (prep-dtd-arg hashmap-fold)
+ dict-map->list-id (prep-dtd-arg hashmap-map->list)
+ dict->alist-id (prep-dtd-arg hashmap->alist)
+ dict-comparator-id (prep-dtd-arg hashmap-key-comparator))))
diff --git a/srfi/srfi-146-impl.scm b/srfi/srfi-146-impl.scm
index bcde849..7d36dc8 100644
--- a/srfi/srfi-146-impl.scm
+++ b/srfi/srfi-146-impl.scm
@@ -6,44 +6,44 @@
(apply proc args)))
(make-dtd
- make-dictionary-index (prep-dtd-arg mapping)
- dictionary?-index (prep-dtd-arg mapping?)
- dict-empty?-index (prep-dtd-arg mapping-empty?)
- dict-contains?-index (prep-dtd-arg mapping-contains?)
- dict-ref-index (prep-dtd-arg mapping-ref)
- dict-ref/default-index (prep-dtd-arg mapping-ref/default)
- dict-set-index (prep-dtd-arg mapping-set)
- dict-set!-index (prep-dtd-arg mapping-set!)
- dict-adjoin-index (prep-dtd-arg mapping-adjoin)
- dict-adjoin!-index (prep-dtd-arg mapping-adjoin!)
- dict-delete-index (prep-dtd-arg mapping-delete)
- dict-delete!-index (prep-dtd-arg mapping-delete!)
- dict-delete-all-index (prep-dtd-arg mapping-delete-all)
- dict-delete-all!-index (prep-dtd-arg mapping-delete-all!)
- dict-replace-index (prep-dtd-arg mapping-replace)
- dict-replace!-index (prep-dtd-arg mapping-replace!)
- dict-intern-index (prep-dtd-arg mapping-intern)
- dict-intern!-index (prep-dtd-arg mapping-intern!)
- dict-update-index (prep-dtd-arg mapping-update)
- dict-update!-index (prep-dtd-arg mapping-update!)
- dict-update/default-index (prep-dtd-arg mapping-update/default)
- dict-update/default!-index (prep-dtd-arg mapping-update!/default)
- dict-pop-index (prep-dtd-arg mapping-pop)
- dict-pop!-index (prep-dtd-arg mapping-pop!)
- dict-filter-index (prep-dtd-arg mapping-filter)
- dict-filter!-index (prep-dtd-arg mapping-filter!)
- dict-remove-index (prep-dtd-arg mapping-remove)
- dict-remove!-index (prep-dtd-arg mapping-remove!)
- dict-search-index (prep-dtd-arg mapping-search)
- dict-search!-index (prep-dtd-arg mapping-search!)
- dict-copy-index (prep-dtd-arg mapping-copy)
- dict-size-index (prep-dtd-arg mapping-size)
- dict-for-each-index (prep-dtd-arg mapping-for-each)
- dict-count-index (prep-dtd-arg mapping-count)
- dict-keys-index (prep-dtd-arg mapping-keys)
- dict-values-index (prep-dtd-arg mapping-values)
- dict-entries-index (prep-dtd-arg mapping-entries)
- dict-fold-index (prep-dtd-arg mapping-fold)
- dict-map->list-index (prep-dtd-arg mapping-map->list)
- dict->alist-index (prep-dtd-arg mapping->alist)
- dict-comparator-index (prep-dtd-arg mapping-key-comparator))))
+ make-dictionary-id (prep-dtd-arg mapping)
+ dictionary?-id (prep-dtd-arg mapping?)
+ dict-empty?-id (prep-dtd-arg mapping-empty?)
+ dict-contains?-id (prep-dtd-arg mapping-contains?)
+ dict-ref-id (prep-dtd-arg mapping-ref)
+ dict-ref/default-id (prep-dtd-arg mapping-ref/default)
+ dict-set-id (prep-dtd-arg mapping-set)
+ dict-set!-id (prep-dtd-arg mapping-set!)
+ dict-adjoin-id (prep-dtd-arg mapping-adjoin)
+ dict-adjoin!-id (prep-dtd-arg mapping-adjoin!)
+ dict-delete-id (prep-dtd-arg mapping-delete)
+ dict-delete!-id (prep-dtd-arg mapping-delete!)
+ dict-delete-all-id (prep-dtd-arg mapping-delete-all)
+ dict-delete-all!-id (prep-dtd-arg mapping-delete-all!)
+ dict-replace-id (prep-dtd-arg mapping-replace)
+ dict-replace!-id (prep-dtd-arg mapping-replace!)
+ dict-intern-id (prep-dtd-arg mapping-intern)
+ dict-intern!-id (prep-dtd-arg mapping-intern!)
+ dict-update-id (prep-dtd-arg mapping-update)
+ dict-update!-id (prep-dtd-arg mapping-update!)
+ dict-update/default-id (prep-dtd-arg mapping-update/default)
+ dict-update/default!-id (prep-dtd-arg mapping-update!/default)
+ dict-pop-id (prep-dtd-arg mapping-pop)
+ dict-pop!-id (prep-dtd-arg mapping-pop!)
+ dict-filter-id (prep-dtd-arg mapping-filter)
+ dict-filter!-id (prep-dtd-arg mapping-filter!)
+ dict-remove-id (prep-dtd-arg mapping-remove)
+ dict-remove!-id (prep-dtd-arg mapping-remove!)
+ dict-search-id (prep-dtd-arg mapping-search)
+ dict-search!-id (prep-dtd-arg mapping-search!)
+ dict-copy-id (prep-dtd-arg mapping-copy)
+ dict-size-id (prep-dtd-arg mapping-size)
+ dict-for-each-id (prep-dtd-arg mapping-for-each)
+ dict-count-id (prep-dtd-arg mapping-count)
+ dict-keys-id (prep-dtd-arg mapping-keys)
+ dict-values-id (prep-dtd-arg mapping-values)
+ dict-entries-id (prep-dtd-arg mapping-entries)
+ dict-fold-id (prep-dtd-arg mapping-fold)
+ dict-map->list-id (prep-dtd-arg mapping-map->list)
+ dict->alist-id (prep-dtd-arg mapping->alist)
+ dict-comparator-id (prep-dtd-arg mapping-key-comparator))))
diff --git a/srfi/srfi-69-impl.scm b/srfi/srfi-69-impl.scm
index 4151dba..ee619e0 100644
--- a/srfi/srfi-69-impl.scm
+++ b/srfi/srfi-69-impl.scm
@@ -99,24 +99,24 @@
(t69:hash-table-hash-function table)))
(make-dtd
- make-dictionary-index t69:make-hash-table*
- dictionary?-index (prep-dtd-arg t69:hash-table?)
- dict-ref-index t69:hash-table-ref*
- dict-ref/default-index (prep-dtd-arg t69:hash-table-ref/default)
- dict-set!-index t69:hash-table-set!*
- dict-delete-all!-index t69:hash-table-delete-all!*
- dict-contains?-index (prep-dtd-arg t69:hash-table-exists?)
- dict-update/default!-index t69:hash-table-update!/default*
- dict-size-index (prep-dtd-arg t69:hash-table-size)
- dict-keys-index (prep-dtd-arg t69:hash-table-keys)
- dict-values-index (prep-dtd-arg t69:hash-table-values)
- dict-map!-index t69:hash-table-map!*
- dict-filter!-index t69:hash-table-filter!*
- dict-filter-index t69:hash-table-filter*
- dict-for-each-index t69:hash-table-foreach*
- dict-fold-index t69:hash-table-fold*
- dict->alist-index (prep-dtd-arg t69:hash-table->alist)
- dict-search-index t69:hash-table-search*
- dict-search!-index t69:hash-table-search!*
- dict-comparator-index t69:hash-table-comparator*
- dict-copy-index (prep-dtd-arg t69:hash-table-copy))))
+ make-dictionary-id t69:make-hash-table*
+ dictionary?-id (prep-dtd-arg t69:hash-table?)
+ dict-ref-id t69:hash-table-ref*
+ dict-ref/default-id (prep-dtd-arg t69:hash-table-ref/default)
+ dict-set!-id t69:hash-table-set!*
+ dict-delete-all!-id t69:hash-table-delete-all!*
+ dict-contains?-id (prep-dtd-arg t69:hash-table-exists?)
+ dict-update/default!-id t69:hash-table-update!/default*
+ dict-size-id (prep-dtd-arg t69:hash-table-size)
+ dict-keys-id (prep-dtd-arg t69:hash-table-keys)
+ dict-values-id (prep-dtd-arg t69:hash-table-values)
+ dict-map!-id t69:hash-table-map!*
+ dict-filter!-id t69:hash-table-filter!*
+ dict-filter-id t69:hash-table-filter*
+ dict-for-each-id t69:hash-table-foreach*
+ dict-fold-id t69:hash-table-fold*
+ dict->alist-id (prep-dtd-arg t69:hash-table->alist)
+ dict-search-id t69:hash-table-search*
+ dict-search!-id t69:hash-table-search!*
+ dict-comparator-id t69:hash-table-comparator*
+ dict-copy-id (prep-dtd-arg t69:hash-table-copy))))