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/tutorial/list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorial/list.html') diff --git a/docs/tutorial/list.html b/docs/tutorial/list.html index 4df69829..35853585 100644 --- a/docs/tutorial/list.html +++ b/docs/tutorial/list.html @@ -338,7 +338,7 @@

Multiplication is harder, and if we try to multiply by the place value list directly it doesn't go so well.

↗️
    (2⋆↕8) × '0' -˜ "01001110""01100101""01110010""01100100""00100001"
-ERROR
+Error: ×: Expected equal shape prefix (⟨8⟩ ≡ ≢𝕨, ⟨5⟩ ≡ ≢𝕩)
 

This is because the list on the left has length 8 while the list on the right has length 5. The elements of the list on the right have length 8, but BQN can't be expected to know you want to connect the two arguments in that particular way. Especially considering that if you happen to have 8 characters then the right argument will have length 8!

There are a few ways to handle this. What we'll do is bind the place values to × using the 2-modifier . This modifier attaches a left argument to a function.

-- cgit v1.2.3