diff options
Diffstat (limited to 'docs/doc/indices.html')
| -rw-r--r-- | docs/doc/indices.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/doc/indices.html b/docs/doc/indices.html index 5c0b9ef6..b062b1b3 100644 --- a/docs/doc/indices.html +++ b/docs/doc/indices.html @@ -100,5 +100,5 @@ <p>Because indices for cells of the same rank have the same shape, it makes sense to make multiple k-cell indices the rows of an array instead of enclosing them. Here's a definition for Select (<code><span class='Function'>β</span></code>) when <code><span class='Value'>π¨</span></code> is an array of numbers with rank 1 or more: replace each row of <code><span class='Value'>π¨</span></code> with the cell of <code><span class='Value'>π©</span></code> that it indicates, yielding a result with the same depth as <code><span class='Value'>π©</span></code> and shape <code><span class='Paren'>(</span><span class='Number'>Β―1</span><span class='Function'>ββ’</span><span class='Value'>π¨</span><span class='Paren'>)</span><span class='Function'>βΎ</span><span class='Paren'>(</span><span class='Number'>Β―1</span><span class='Function'>ββ’</span><span class='Value'>π¨</span><span class='Paren'>)</span><span class='Function'>ββ’</span><span class='Value'>π©</span></code>.</p> <p>To match this format, Range (<code><span class='Function'>β</span></code>) could be changed to return a flat array when given a shape <code><span class='Value'>π©</span></code>βwhat is now <code><span class='Function'>>β</span></code>. Following this pattern, Indices (<code><span class='Function'>/</span></code>) would also return a flat array, where the indices are rows: using the modified Range, <code><span class='Function'>β₯/β</span><span class='Modifier2'>β</span><span class='Function'>β’</span></code>. Here the result cannot retain the argument's array structure; it's always a rank-2 list of rows.</p> <p>The most interesting feature would be that Select could still allow <code><span class='Value'>π¨</span></code> to be nested. In this case each element of <code><span class='Value'>π¨</span></code> would be an array with cell indices for its rows as before. However, each row can now index along multiple axes, allowing some adjacent axes to be dependent while others remain independent. This nicely unifies scatter-point and per-axis selection, and allows a mix of the two. However, it doesn't allow total freedom, as non-adjacent axes can't be combined except by also mixing in all axes in between.</p> -<p>Group (<code><span class='Function'>β</span></code>) could accept the same index format for its index argument <code><span class='Value'>π¨</span></code>. Each depth-1 array in <code><span class='Value'>π¨</span></code> would correspond to multiple axes in the outer result array, but only a single axis in <code><span class='Value'>π©</span></code> and inner arrays. Because the ravel ordering of indices must be used to order cells of inner arrays, this modification is not quite as clean as the change to Select. It's also not so clearly useful, as the same results can be obtained by using atomic indices and reshaping the result.</p> +<p>Group (<code><span class='Function'>β</span></code>) could accept the same index format for its index argument <code><span class='Value'>π¨</span></code>. Each depth-1 array in <code><span class='Value'>π¨</span></code> would correspond to multiple axes in the outer result array, but only a single axis in <code><span class='Value'>π©</span></code> and inner arrays. Because the index ordering of indices must be used to order cells of inner arrays, this modification is not quite as clean as the change to Select. It's also not so clearly useful, as the same results can be obtained by using atomic indices and reshaping the result.</p> <p>Overall it seems to me that the main use of cell indices of the type discussed here is for the Select primitive, and the other cases are somewhat contrived and awkward. So I've chosen not to support it in BQN at all.</p> |
