aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/order.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-08 16:14:51 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-08 16:18:16 -0500
commitc5eef0418df2ae6a97c54839fa010ff60d96f78b (patch)
tree7ad892f4d416cfcf380e3a26164df4d240a82037 /docs/doc/order.html
parentded5581732544165dbb14fb2481ab3855104c638 (diff)
Add error messages to generated markdown docs with •CurrentError (fixes #22)
Diffstat (limited to 'docs/doc/order.html')
-rw-r--r--docs/doc/order.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/doc/order.html b/docs/doc/order.html
index bd13f64a..1916167d 100644
--- a/docs/doc/order.html
+++ b/docs/doc/order.html
@@ -88,9 +88,9 @@
<p>The two Bins functions are written with the same symbols <code><span class='Function'>⍋</span></code> and <code><span class='Function'>⍒</span></code> as Grade, but take two arguments instead of one. More complicated? A little, but once you understand Bins you'll find that it's a basic concept that shows up in the real world all the time.</p>
<p>Bins behaves like a <a href="search.html">search function</a> with respect to rank: it looks up cells from <code><span class='Value'>𝕩</span></code> relative to major cells of <code><span class='Value'>𝕨</span></code>. However, there's an extra requirement: the left argument to Bins is already sorted according to whichever ordering is used. If it isn't, you'll get an error.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=NeKAvzbigL8y4oC/NOKAvzEg4o2LIDMKMOKAvzPigL804oC/N+KAvzkg4o2SIDM=">↗️</a><pre> <span class='Number'>5</span><span class='Ligature'>‿</span><span class='Number'>6</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>4</span><span class='Ligature'>‿</span><span class='Number'>1</span> <span class='Function'>⍋</span> <span class='Number'>3</span>
-ERROR
+<span class='Error'>Error: ⍋: 𝕨 must be sorted</span>
<span class='Number'>0</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>4</span><span class='Ligature'>‿</span><span class='Number'>7</span><span class='Ligature'>‿</span><span class='Number'>9</span> <span class='Function'>⍒</span> <span class='Number'>3</span>
-ERROR
+<span class='Error'>Error: ⍒: 𝕨 must be sorted in descending order</span>
</pre>
<p>Given this, the simplest definition of <code><span class='Value'>𝕨</span><span class='Function'>⍋</span><span class='Value'>𝕩</span></code> (or <code><span class='Value'>𝕨</span><span class='Function'>⍒</span><span class='Value'>𝕩</span></code>) is that for each cell in <code><span class='Value'>𝕩</span></code> of rank <code><span class='Paren'>(</span><span class='Function'>=</span><span class='Value'>𝕨</span><span class='Paren'>)</span><span class='Function'>-</span><span class='Number'>1</span></code>, it counts the number of major cells from <code><span class='Value'>𝕨</span></code> that come earlier in the ordering, or match that cell.</p>
<p>Why would that be useful? How about an example. A pinball machine has some high scores on it. You play, and your rank is the number of scores higher than yours (in this case, if you tie someone's score, you won't unseat them).</p>