From c3ca745d472c6dd8fb54c023f1922bc9805b48d2 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 2 Dec 2020 14:58:08 -0500 Subject: Include trailing newline in ERROR for code blocks --- docs/tutorial/list.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/tutorial') diff --git a/docs/tutorial/list.html b/docs/tutorial/list.html index 4d867329..05e4b9c5 100644 --- a/docs/tutorial/list.html +++ b/docs/tutorial/list.html @@ -335,7 +335,8 @@

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 +

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.

↗️
    "ab" ¨  "cd", "ut" 
-- 
cgit v1.2.3