That’s a feature! It’s wholly consistent with how omitting indexing dimensions work in general. In other words, it’s a nice shorthand for grabbing the only element — and ensuring that there’s only one.
mbauman
9
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| What is empty index notation? | 8 | 683 | April 20, 2022 | |
| Recovering MATLAB addict needs help to understand Julia indexing | 1 | 396 | February 25, 2021 | |
| Juliacall access zero-dimensional array with [] | 3 | 377 | June 22, 2023 | |
| Zero-dimensional array interface for custom type | 1 | 202 | February 23, 2024 | |
| Why does `[42][]` work? | 6 | 915 | January 17, 2019 |