From c5eef0418df2ae6a97c54839fa010ff60d96f78b Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 8 Jan 2022 16:14:51 -0500 Subject: =?UTF-8?q?Add=20error=20messages=20to=20generated=20markdown=20do?= =?UTF-8?q?cs=20with=20=E2=80=A2CurrentError=20(fixes=20#22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/doc/pick.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/pick.html') diff --git a/docs/doc/pick.html b/docs/doc/pick.html index d3166012..a5e9392b 100644 --- a/docs/doc/pick.html +++ b/docs/doc/pick.html @@ -57,9 +57,9 @@

If 𝕩 is empty then First results in an error, like Pick.

↗️
     ""
-ERROR
+Error: ⊑: Argument cannot be empty
      π
-ERROR
+Error: ⊑: Argument cannot be empty
 

In APL it's common to get the last element of a list with an idiom that translates to ⊑⌽, or First-Reverse. In BQN the most straightforward way is to select with index ¯1 instead. I also sometimes use Fold with the Right identity function.

↗️
    ⊑⌽ "last"
@@ -84,7 +84,7 @@ ERROR
 

These indices have to be lists, since if they're numbers it just looks like 𝕨 is one list index.

↗️
    2,1,0,¯1  "abc"  # 𝕩 doesn't have rank 4!
-ERROR
+Error: ⊑: Picking item at wrong rank (index 2‿1‿0‿¯1 in array of shape ⟨3⟩)
 
     2,1,0,¯1 ¨ "abc"
 "cbac"
@@ -124,5 +124,5 @@ ERROR
               ┘
 
     ⟨⟨2,3,1  a  # 1 isn't a valid index
-ERROR
+Error: ⊑: 𝕨 contained list with mixed-type elements
 
-- cgit v1.2.3