From bed78fe6147cb7921b7367960d406d28d37cb019 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Tue, 7 Jun 2022 22:16:01 -0400 Subject: The editing is going to end at some point isn't it? --- docs/doc/scan.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/doc/scan.html') diff --git a/docs/doc/scan.html b/docs/doc/scan.html index c975e35c..bac2f4c5 100644 --- a/docs/doc/scan.html +++ b/docs/doc/scan.html @@ -58,7 +58,7 @@ -

The 1-modifier Scan (`) moves along the first axis of the array ๐•ฉ, building up an array of results by applying ๐”ฝ repeatedly beginning with ๐•จ or โŠ๐•ฉ. It's related to the fold modifiers, and most closely resembles the APL2-style reduction ยจห, but it traverses the array in forward rather than reverse index order, and includes all intermediate results of ๐”ฝ in its output instead of just the final one.

+

The 1-modifier Scan (`) moves along the first axis of the array ๐•ฉ, building up an array of results by applying ๐”ฝ repeatedly beginning with ๐•จ or โŠ๐•ฉ. It's related to the fold modifiers, and most closely resembles the APL2-style reduction ยจห, but it traverses the array in forward rather than reverse index order, and includes all intermediate results of ๐”ฝ in its output instead of just the final one.

BQN's Scan is ordered differently from Scan in APL. Both include one result for each non-empty prefix of ๐•ฉ. In BQN this is a left-to-right fold, so that each new result requires one application of ๐”ฝ. APL uses right-to-left folds, which matches with reduction, but requires starting over at the end for each new prefix, except in special cases. If needed, this definition can be obtained with a fold on each prefix except the first (which is empty). In the particular case of -โ€, that nested solution isn't needed: negate odd-indexed elements and then apply +`.

Scan also differs from Fold or Insert in that it never depends on ๐”ฝ's identity value, because scanning over an empty array simply returns that array.

Lists

@@ -142,7 +142,7 @@ ยฏ2 0.25 'a' โˆž โ”˜ -

If ๐•จ is given, it must have the same shape as a major cell of ๐•ฉ (this is why ๐•จ needs to be enclosed when ๐•ฉ is a list: in general it's an array). Then the first result cell is found by applying ๐”ฝ to elements of ๐•จ and โŠ๐•ฉ, and the computation continues as in the one-argument case for remaining cells.

+

If ๐•จ is given, it must have the same shape as a major cell of ๐•ฉ (this is why ๐•จ needs to be enclosed when ๐•ฉ is a list: in general it's an array). Then the first result cell is found by applying ๐”ฝ to elements of ๐•จ and โŠ๐•ฉ, and the computation continues as in the one-argument case for remaining cells.

โ†—๏ธ
    3โ€ฟ2โ€ฟ1โ€ฟ0 +` a
 โ”Œโ”€              
 โ•ต 1 2.25 'b' โˆž  
-- 
cgit v1.2.3