From 2afb23928e1984d475cc460e1672e8f6fa0e4dbe Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 11 Aug 2021 17:21:31 -0400 Subject: Allow clicking on header to get fragment link --- docs/doc/assert.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/doc/assert.html') diff --git a/docs/doc/assert.html b/docs/doc/assert.html index 7630f925..2e112283 100644 --- a/docs/doc/assert.html +++ b/docs/doc/assert.html @@ -4,7 +4,7 @@ BQN: Assert -

Assert

+

Assert

BQN takes the position that errors exist to indicate exceptional conditions that the developer of a given program didn't expect. However, the types of errors that BQN naturally checks for, such as mismatched shapes in Couple (), aren't always enough to detect exceptional conditions. Issues like numeric values that don't make physical sense will slip right through. BQN makes it easy for a programmer to check for these sorts of problems by building in the primitive Assert, written !. This function checks whether 𝕩 matches 1: if it does, then it does nothing and returns 𝕩, and otherwise it gives an error.

↗️
    ! 2=2  # Passed
 1
@@ -23,7 +23,7 @@ ERROR
     ,"abc",˜ ! '0'  # Okay this is not a very helpful printout
 ERROR
 
-

Computing the error message on demand

+

Computing the error message on demand

Because the left argument to a function is always computed before the function is called, Assert doesn't let you compute the error message only if there's an error. This might be a problem if the error message computation is slow or has side effects. There are a few ways to work around the issue: