From 7bf2aa4054b8378a76dff63acdccbcdad91f68e6 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 7 Aug 2021 20:41:31 -0400 Subject: BREAKING: Don't allow First of empty or reshaping empty to non-empty --- docs/doc/find.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/doc/find.html') diff --git a/docs/doc/find.html b/docs/doc/find.html index bc883db2..1421500e 100644 --- a/docs/doc/find.html +++ b/docs/doc/find.html @@ -32,14 +32,14 @@ "string" (⊢↑⍷) "substring" # APL style ⟨ 0 0 0 1 0 0 0 0 0 ⟩ -

If 𝕨 is larger than 𝕩, the result is empty, and there's no error even in cases where Windows would fail. One place this tends to come up is when applying First () the result: ⊑⍷ tests whether 𝕨 appears in 𝕩 at the first position, that is, whether it's a prefix of 𝕩. If 𝕨 is longer than 𝕩 it shouldn't be a prefix, so 0 is appropriate.

-↗️
    "loooooong"  "short"
+

If 𝕨 is larger than 𝕩, the result is empty, and there's no error even in cases where Windows would fail. One place this tends to come up is when applying First () the result: ⊑⍷ tests whether 𝕨 appears in 𝕩 at the first position, that is, whether it's a prefix of 𝕩. If 𝕨 is longer than 𝕩 it shouldn't be a prefix. First will fail but using a fold 0´ instead gives a 0 in this case.

+↗️
    "loooooong"  "short"
 ⟨⟩
 
     9  "short"
 ERROR
 
-     "loooooong"  "short"
+    0 ´ "loooooong"  "short"
 0
 

This pattern also works in the high-rank case discussed below, testing whether 𝕨 is a multi-dimensional prefix starting at the lowest-index corner of 𝕩.

-- cgit v1.2.3