Bracket Indexing¶
Syntax¶
V[i] ⍝ select from vector
M[r;c] ⍝ select from matrix
M[r;] ⍝ all columns of selected rows
M[;c] ⍝ all rows of selected columns
Semicolons separate axis specifications. An empty axis (nothing before or after a semicolon) selects all indices along that axis.
Vector indexing¶
Matrix indexing¶
Result shape¶
- Scalar index on each axis: scalar result.
- Vector index on one axis, scalar on others: vector result.
- Vector indices on both axes: matrix result (cross-section).
Index origin¶
Bracket indexing respects ⎕IO.
Limitations¶
Bracket indexing is special syntax, not a function. You cannot pass it to operators or compose it. For composable indexing, use From (⌷).
Currently supports vectors and matrices (up to rank 2). Higher-rank arrays raise RANK ERROR.
See also¶
- From (
⌷) -- function-based major-cell selection - Indexed Assignment -- not yet implemented