summaryrefslogtreecommitdiffstats
path: root/srfi-225.html
diff options
context:
space:
mode:
authorGravatar John Cowan 2022-02-05 14:53:58 -0500
committerGravatar GitHub 2022-02-05 14:53:58 -0500
commitf7d9516172bf82e0a49563c3d4a5efe0aff17c98 (patch)
treed13d4c19fca50381f0af1c0ebc9f37b86e0862d3 /srfi-225.html
parentUpdate srfi-225.html (diff)
Update srfi-225.html
Diffstat (limited to '')
-rw-r--r--srfi-225.html33
1 files changed, 21 insertions, 12 deletions
diff --git a/srfi-225.html b/srfi-225.html
index 3232940..48fed8b 100644
--- a/srfi-225.html
+++ b/srfi-225.html
@@ -393,25 +393,35 @@ and <code>dict-find-update</code>.
The last two may be <code>#f</code> if the dictionary does not make use of these functions.</p>
<p>If no comparator is relevant to the dictionary type, returns <code>#f</code>.</p>
<h3 id="iteration">Iteration</h3>
-<p><code>(dict-for-each</code>&nbsp;<em>dto proc dict</em><code>)</code></p>
+ <p><code>(dict-for-each</code>&nbsp;<em>dto proc dict</em> [ <em>start</em> [ <em>end</em> ] ] <code>)</code></p>
<p>Invokes <em>proc</em> on each key of <em>dict</em> and its corresponding value in that order.
This procedure is used for doing operations on the whole dictionary.
- If the dictionary type is inherently ordered, associations are processed in that order; otherwise in an arbitrary order.
- Returns an unspecified value.</p>
+ If the dictionary type is inherently ordered, associations are processed in the order specified
+ by the dictionary's comparator; otherwise they are processed in an arbitrary order.
+ The <em>start</em> and <em>end</em> arguments specify the inclusive lower bound and exclusive upper bound
+ of the keys (in the sense of the dictionary's comparator).
+ They can can provide additional efficiency when iterating over part of the dictionary
+ if the dictionary is ordered. The procedure returns an unspecified value.</p>
<blockquote><pre>(define (write-key key value) (write key))
(dict-for-each write-key aed dict) =&gt; unspecified
; writes &quot;135&quot; to current output</pre></blockquote>
-<h3 id="generator-procedures">Generator procedures</h3>
-<p><code>(dict-&gt;generator</code>&nbsp;<em>dto dict</em><code>)</code></p>
+<p><code>(dict-&gt;generator</code>&nbsp;<em>dto dict</em> [ <em>start</em> [ <em>end</em> ] ] <code>)</code></p>
<p>Returns a <a href="https://srfi.schemers.org/srfi-158/srfi-158.html">SRFI 158 generator</a>
that when invoked returns the associations of <em>dict</em> as pairs.
- When no associations are left, returns an end-of-file object.
- If the dictionary type is inherently ordered, associations are processed in that order;
- otherwise in an arbitrary order.
- It is an error to mutate <em>dict</em> until the generator is exhausted.</p>
-<p><code>(dict-set-accumulator</code>&nbsp;<em>dto dict</em><code>)</code><br>
+ This procedure is used for doing operations on the whole dictionary.
+ If the dictionary type is inherently ordered, associations are processed in the order specified
+ by the dictionary's comparator; otherwise they are processed in an arbitrary order.
+ <p>The <em>start</em> and <em>end</em> arguments specify the inclusive lower bound and exclusive upper bound
+ of the keys to be processed (in the sense of the dictionary's comparator).
+ They can can provide additional efficiency when iterating over part of the dictionary
+ if the dictionary is ordered. The procedure returns an unspecified value.</p>
+ <p>It is an error to mutate <em>dict</em> until after the generator is exhausted.
+ When all the associations have been processed, returns an end-of-file object.</>
+ <p><code>(dict-set-accumulator</code>&nbsp;<em>dto dict</em><code>)</code><br>
<code>(dict-set!-accumulator</code>&nbsp;<em>dto dict accum</em><code>)</code></p>
-<p>Returns a SRFI 158 accumulator procedure that when invoked on a pair adds the <code>car</code> and <code>cdr</code> of the pair as a key and value of <em>dict</em> as if by <em>dict-set</em>, eventually returning the new value of <em>dict</em>. If invoked on an end-of-file object, no action is taken and <em>dict</em> is returned.</p>
+<p>Returns a SRFI 158 accumulator procedure that when invoked on a pair adds the <code>car</code> and <code>cdr</code> of the pair
+ as a key and value of <em>dict</em> as if by <em>dict-set</em>, eventually returning the new value of <em>dict</em>.
+ If invoked on an end-of-file object, no action is taken and <em>dict</em> is returned.</p>
<p>The <code>!</code> variant uses <code>dict-set!</code> instead.
<p><code>(dict-adjoin-accumulator</code>&nbsp;<em>dto dict</em><code>)</code><br>
<code>(dict-adjoin!-accumulator!</code>&nbsp;<em>dto dict</em><code>)</code></p>
@@ -600,7 +610,6 @@ new dictionary types that may not have complete dictionary APIs:</p>
<dt>dict-map-&gt;list</dt>
<dd>dict-fold</dd>
- <dt>dict-&gt;alist</dt>
<dd>dict-map-&gt;list</dd>
<dt>dict-for-each&gt;</dt>
ar/c0d659f6478af09368d907b3d3c9a377?s=13&d=retro' width='13' height='13' alt='Gravatar' /> gingerBill 2-330/+640 2015-10-04gb.hpp - ComplexGravatar gingerBill 2-276/+778 2015-10-03gb.hpp - AtomicsGravatar gingerBill 1-102/+500 2015-10-02gb.hpp - Bug FixesGravatar Ginger Bill 3-38/+50 2015-09-30gb.hpp - Matrix(2,3)Gravatar gingerBill 2-29/+421 2015-09-29Update README.mdGravatar gingerBill 1-1/+1 2015-09-29gb.hpp - Fix BugsGravatar gingerBill 2-41/+111 2015-09-29gb_string.h - Fix typos and errorsGravatar gingerBill 1-5/+6 2015-09-28Os spec ideasGravatar gingerBill 1-29/+126 2015-09-28gb.hpp - Transform Type and Quaternion FunctionsGravatar gingerBill 1-27/+205 2015-09-28gb.hpp - StringGravatar gingerBill 1-37/+647 2015-09-28gb.hpp - Time functionsGravatar gingerBill 1-481/+765 2015-09-27gb.hpp - Hash Table SupportGravatar gingerBill 2-137/+592 2015-09-27Add experimental gb.hppGravatar gingerBill 2-4/+2257 2015-09-27Fix Silly MistakesGravatar gingerBill 2-150/+151 2015-09-27Update README.mdGravatar gingerBill 1-1/+2 2015-09-27Add extern "C" if compiling as C++Gravatar gingerBill 2-8/+27