diff --git a/doc/search.md b/doc/search.md index e1e1d8eb..acbf6eb7 100644 --- a/doc/search.md +++ b/doc/search.md @@ -159,7 +159,7 @@ The searched-in argument is treated as a list of its [major cells](array.md#cell rows β [["row","row","col"],["rho","cow","col"]] -So the result rank of `β` is always `π¨Β¬β=π©`, with a result shape `(1-Λ=π¨)ββ’π©`, and `π¨βπ©` fails if `1>=π©` or the result rank would be negative. In the list case, we have `1==π©` (so the first condition holds), and the result rank resolves to `=π¨` (which can't be negative, so the second holds as well). The cell rank of `π©` is 0, and the fact that a 0-cell of `π©` gives a 0-cell of the result is what causes the shape arithmetic to be so simple. +So the result rank of `β` is always `π©Β¬β=π¨`, with a result shape `(Β¬=π¨)ββ’π©`, and `π¨βπ©` fails if `1>=π¨` or the result rank would be negative. In the list case, we have `1==π¨` (so the first condition holds), and the result rank resolves to `=π©` (which can't be negative, so the second holds as well). The cell rank of `π©` is 0, and the fact that a 0-cell of `π©` gives a 0-cell of the result is what causes the shape arithmetic to be so simple. For Member of, the arguments are reversed relative to Index of, but otherwise everything's the same. This differs from APL, where entries are always elements, not cells. Many APL designers consider the APL definition to be a failure of foresight and would prefer BQN's definitionβor rather A+'s or J's definition, as these languages were actually the first to use it. The rank-aware version is more flexible, as it allows both searching for elements and searching for rows. APL would return the first result in both cases below. diff --git a/docs/doc/search.html b/docs/doc/search.html index a6435518..b0722f12 100644 --- a/docs/doc/search.html +++ b/docs/doc/search.html @@ -251,7 +251,7 @@
So the result rank of β
is always π¨Β¬β=π©
, with a result shape (1-Λ=π¨)ββ’π©
, and π¨βπ©
fails if 1>=π©
or the result rank would be negative. In the list case, we have 1==π©
(so the first condition holds), and the result rank resolves to =π¨
(which can't be negative, so the second holds as well). The cell rank of π©
is 0, and the fact that a 0-cell of π©
gives a 0-cell of the result is what causes the shape arithmetic to be so simple.
So the result rank of β
is always π©Β¬β=π¨
, with a result shape (Β¬=π¨)ββ’π©
, and π¨βπ©
fails if 1>=π¨
or the result rank would be negative. In the list case, we have 1==π¨
(so the first condition holds), and the result rank resolves to =π©
(which can't be negative, so the second holds as well). The cell rank of π©
is 0, and the fact that a 0-cell of π©
gives a 0-cell of the result is what causes the shape arithmetic to be so simple.
For Member of, the arguments are reversed relative to Index of, but otherwise everything's the same. This differs from APL, where entries are always elements, not cells. Many APL designers consider the APL definition to be a failure of foresight and would prefer BQN's definitionβor rather A+'s or J's definition, as these languages were actually the first to use it. The rank-aware version is more flexible, as it allows both searching for elements and searching for rows. APL would return the first result in both cases below.
βοΈ[2βΏ1,3βΏ1] β 3βΏ1βΏ4βΏ3 ββ