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/map.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/doc/map.html') diff --git a/docs/doc/map.html b/docs/doc/map.html index b7c4afe5..f84421cf 100644 --- a/docs/doc/map.html +++ b/docs/doc/map.html @@ -219,7 +219,7 @@

If the argument lengths don't match then Each gives an error. This contrasts with zip in many languages, which drops elements from the longer argument (this is natural for linked lists). This flexibility is rarely wanted in BQN, and having an error right away saves debugging time.

↗️
    "ABC" ¨ "01234"
-ERROR
+Error: Mapping: Expected equal shape prefix (⟨3⟩ ≡ ≢𝕨, ⟨5⟩ ≡ ≢𝕩)
 

Arguments can have any shape as long as the axis lengths match up. As with Table, the result elements don't depend on these shapes but the result shape does.

↗️
    (>203010,504060) +¨ 210321
@@ -230,10 +230,10 @@ ERROR
 

But arguments don't have to have exactly the same shape: just the same length along corresponding axes. These axes are matched up according to the leading axis convention, so that one argument's shape has to be a prefix of the other's. With equal ranks, the shapes do have to match as we've seen above.

↗️
     (026@) ¨ 010  # Too small
-ERROR
+Error: Mapping: Expected equal shape prefix (0‿2‿6 ≡ ≢𝕨, 0‿1 ≡ ≢𝕩)
      (026@) ¨ 020  # Just right
 ⟨ 0 2 6 ⟩
      (026@) ¨ 030  # Too large
-ERROR
+Error: Mapping: Expected equal shape prefix (0‿2‿6 ≡ ≢𝕨, 0‿3 ≡ ≢𝕩)
 

Leading axis agreement is described further here.

-- cgit v1.2.3