Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
computerphage
· 9y ago · 0 comments
It would be nice to have access to an overloadable index operator that works on multiple dimensions at once (like C#'s [1, 2, 5] syntax). It's sometimes not easy to write something to be efficient if it has to go one-by-one like [1][2][5].
Comments
[–]
gpm
9y ago
The ndarray library indexes via tuples, i.e. [(1,2,5)], which should be just as efficient as a built in syntax (if perhaps a bit uglier).
[–]
spullara
9y ago
Doesn't Rust have macros that let you modify the syntax? Maybe you could do this.