summary refs log tree commit diff
path: root/srfi-flexvectors.html
diff options
context:
space:
mode:
authorArthur A. Gleckler <srfi@speechcode.com>2020-10-07 09:45:05 -0700
committerArthur A. Gleckler <srfi@speechcode.com>2020-10-07 09:51:20 -0700
commit56fec159a8e435fd66b6b0dad6022968a6fe34e6 (patch)
treeeec566a78b7ccdcd9fca7493dce00c051ec1c16e /srfi-flexvectors.html
parentbaf35d5206a4ce1d05e0ccff5e6715c432dd6b89 (diff)
downloadsrfi-214-56fec159a8e435fd66b6b0dad6022968a6fe34e6.tar.gz
srfi-214-56fec159a8e435fd66b6b0dad6022968a6fe34e6.tar.xz
srfi-214-56fec159a8e435fd66b6b0dad6022968a6fe34e6.zip
copy edit
Diffstat (limited to 'srfi-flexvectors.html')
-rw-r--r--srfi-flexvectors.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/srfi-flexvectors.html b/srfi-flexvectors.html
index a1c0af3..3626b21 100644
--- a/srfi-flexvectors.html
+++ b/srfi-flexvectors.html
@@ -235,7 +235,7 @@ zot
 <div class="copy-wrapper"><pre><code class="language-scheme"><span><span class="mtk1">(flexvector-skip&nbsp;number?&nbsp;(flexvector&nbsp;</span><span class="mtk21">1</span><span class="mtk1">&nbsp;</span><span class="mtk21">2</span><span class="mtk1">&nbsp;'a&nbsp;'b&nbsp;</span><span class="mtk21">3</span><span class="mtk1">&nbsp;</span><span class="mtk21">4</span><span class="mtk1">&nbsp;'c&nbsp;'d))</span></span><br><span><span class="mtk4">;=&gt;&nbsp;2</span></span><br><span><span>&nbsp;</span></span><br><span><span class="mtk1">(flexvector-skip-right&nbsp;number?&nbsp;(flexvector&nbsp;</span><span class="mtk21">1</span><span class="mtk1">&nbsp;</span><span class="mtk21">2</span><span class="mtk1">&nbsp;'a&nbsp;'b&nbsp;</span><span class="mtk21">3</span><span class="mtk1">&nbsp;</span><span class="mtk21">4</span><span class="mtk1">&nbsp;'c&nbsp;'d))</span></span><br><span><span class="mtk4">;=&gt;&nbsp;4</span></span><br></code></pre></div>

 <h4 id="flexvector-binary-search"><code>flexvector-binary-search</code></h4>

 <p><code>(flexvector-binary-search fv value cmp [start [end]])</code></p>

-<p>Similar to <code>flexvector-index</code> and <code>flexvector-index-right</code>, but, instead of searching left-to-right or right-to-left, this performs a binary search. If there is more than one element of <code>fv</code> that matches <code>value</code> in the sense of <code>cmp</code>, <code>flexvector-binary-search</code> may return the index of any of them.</p>

+<p>Similar to <code>flexvector-index</code> and <code>flexvector-index-right</code>, but instead of searching left-to-right or right-to-left, this performs a binary search. If there is more than one element of <code>fv</code> that matches <code>value</code> in the sense of <code>cmp</code>, <code>flexvector-binary-search</code> may return the index of any of them.</p>

 <p>The search is performed on only the indexes of <code>fv</code> between <code>start</code>, which defaults to 0, and <code>end</code>, which defaults to the length of <code>fv</code>. Both <code>start</code> and <code>end</code> are clamped to the range [0, <code>(flexvector-length fv)</code>]. It is an error if <code>end</code> is less than <code>start</code>.</p>

 <p><code>cmp</code> should be a procedure of two arguments that returns either a negative integer, which indicates that its first argument is less than its second; zero, which indicates that they are equal; or a positive integer, which indicates that the first argument is greater than the second argument. An example <code>cmp</code> might be:</p>

 <div class="copy-wrapper"><pre><code class="language-scheme"><span><span class="mtk1">(λ&nbsp;(char1&nbsp;char2)</span></span><br><span><span class="mtk1">&nbsp;&nbsp;(</span><span class="mtk12">cond</span><span class="mtk1">&nbsp;((char&lt;?&nbsp;char1&nbsp;char2)&nbsp;</span><span class="mtk21">-1</span><span class="mtk1">)</span></span><br><span><span class="mtk1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((char=?&nbsp;char1&nbsp;char2)&nbsp;</span><span class="mtk21">0</span><span class="mtk1">)</span></span><br><span><span class="mtk1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(</span><span class="mtk12">else</span><span class="mtk1">&nbsp;</span><span class="mtk21">1</span><span class="mtk1">)))&nbsp;</span></span><br></code></pre></div>