aboutsummaryrefslogtreecommitdiff
path: root/docs/spec/primitive.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-16 15:44:04 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-16 15:44:04 -0400
commit07bf9008a0698d2ada09fe7db471adb349f1703c (patch)
tree693716dd901e4f96781e188763714058628b2b57 /docs/spec/primitive.html
parent9f437d3468c9078c46d30da68ac3821cacb045e5 (diff)
Specification for Catch (⎊)
Diffstat (limited to 'docs/spec/primitive.html')
-rw-r--r--docs/spec/primitive.html3
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/spec/primitive.html b/docs/spec/primitive.html
index 5b850b6a..a559a85e 100644
--- a/docs/spec/primitive.html
+++ b/docs/spec/primitive.html
@@ -68,6 +68,9 @@
<ul>
<li><strong>Assert</strong> (<code><span class='Function'>!</span></code>) causes an error if the argument is not <code><span class='Number'>1</span></code>. If <code><span class='Value'>𝕨</span></code> is provided, it gives a message to be associated with this error (which can be any value, not necessarily a string).</li>
</ul>
+<ul>
+<li><strong>Catch</strong> (<code><span class='Modifier2'>⎊</span></code>) evaluates <code><span class='Function'>𝔽</span></code> on the arguments <code><span class='Value'>𝕨</span></code> (if present) and <code><span class='Value'>𝕩</span></code>. If <code><span class='Function'>𝔽</span></code> completes without error it returns the result, but if evaluation of <code><span class='Function'>𝔽</span></code> results in an error then the error is suppressed, and Catch evaluates <code><span class='Function'>𝔾</span></code> on the arguments and returns the result. Errors in <code><span class='Function'>𝔾</span></code> are not caught. Catch only prevents evaluation errors, and not syntax errors: these are considered errors in the program as a whole rather than any particular part of it.</li>
+</ul>
<h2 id="commentary-on-other-primitives">Commentary on other primitives</h2>
<p>As noted above, see <a href="https://github.com/mlochbaum/BQN/blob/master/spec/reference.bqn">reference.bqn</a> for the authoritative definitions. Commentary here gives an overall description and highlights implementation subtleties and edge cases.</p>
<h3 id="combinators">Combinators</h3>