On Saturday, 30 June 2012 at 19:06:31 UTC, Jonathan M Davis wrote:
On Saturday, June 30, 2012 21:01:02 Vidar Wahlberg wrote:
This is a very good suggestion, I hadn't thought of this
possibility, this way I can get my beloved "matrix[x][y];"
instead of something like "matrix.get(x, y);".
It might have to be matrix[x, y] though, since while you can
make opIndex take
as many arguments as you want, I don't believe that it will let
you split them
out into multiple indexing operations like in matrix[x][y].
Doh, you are of course correct. That's slightly unfortunate, then
I'm actually leaning a bit more towards creating a "get(x, y)"
method as a "[x, y]" construct would be a bit unusual (at least
for me, for the time being).