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 --- doc/find.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/find.md') diff --git a/doc/find.md b/doc/find.md index b91a5930..5309909f 100644 --- a/doc/find.md +++ b/doc/find.md @@ -18,13 +18,13 @@ Like Windows, the result usually doesn't have the same dimensions as `๐•ฉ`. Thi "string" (โ‰ขโˆ˜โŠขโ†‘โท) "substring" # APL style -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](pick.md) (`โŠ‘`) 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. +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](pick.md#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](fold.md) `0โŠฃยดโฅŠโˆ˜โท` instead gives a 0 in this case. "loooooong" โท "short" 9 โ†• "short" - โŠ‘ "loooooong" โท "short" + 0 โŠฃยด "loooooong" โท "short" 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