From 19d4e4da6a93deb398f87bb6b42b1b1ee3c4926e Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 15 Feb 2021 20:52:54 -0500 Subject: =?UTF-8?q?Give=20an=20empty=20result,=20not=20an=20error,=20whene?= =?UTF-8?q?ver=20=F0=9D=95=A8=20is=20longer=20than=20=F0=9D=95=A9=20in=20F?= =?UTF-8?q?ind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/primitive.md | 2 +- spec/reference.bqn | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'spec') diff --git a/spec/primitive.md b/spec/primitive.md index 95fd9392..386b0dcf 100644 --- a/spec/primitive.md +++ b/spec/primitive.md @@ -197,7 +197,7 @@ Dyadic search functions check whether major cells of the *principal argument* (w - **Index of** (`⊐`) gives the smallest index of a principal argument cell that matches the cell, or `≠𝕨` if there is no such cell. - **Progressive Index of** (`βŠ’`) processes non-principal cells in ravel order, and gives the smallest index of a principal argument cell that matches the cell that hasn't already been included in the result. Again `≠𝕨` is returned for a given cell if there is no valid cell. -**Find** (`⍷`) indicates positions where `𝕨` appears as a contiguous subarray of a `=𝕨`-cell of `𝕩`. It has one result element for each such subarray of `𝕩`, whose value is 1 if that subarray matches `𝕩` and 0 otherwise. +**Find** (`⍷`) indicates positions where `𝕨` appears as a contiguous subarray of a `=𝕨`-cell of `𝕩`. It has one result element for each such subarray of `𝕩`, whose value is 1 if that subarray matches `𝕩` and 0 otherwise. Find cannot result in an error unless the rank of `𝕨` is higher than that of `𝕩`. If `𝕨` is longer along one axis than the corresponding trailing axis of `𝕩`, then the result has length 0 along that axis. Any atom argument to Find is automatically enclosed. ### Sorting diff --git a/spec/reference.bqn b/spec/reference.bqn index c3719144..adad4f13 100644 --- a/spec/reference.bqn +++ b/spec/reference.bqn @@ -414,8 +414,8 @@ MarkFirst←{ Find←{ r←=𝕨 ! r≀=𝕩 - 𝕨 β‰‘βŽ‰r (≒𝕨) β†•βŽ‰r 𝕩 -} + 𝕨 β‰‘βŽ‰r ((1+r-βŠΈβ†‘β‰’π•©)βŒŠβ‰’π•¨)βŠΈβ†•βŽ‰r 𝕩 +}β—‹ToArray ReorderAxes←{ 𝕩↩<⍟(0=≑)𝕩 -- cgit v1.2.3