Re:Python 3.5 to Ship with Matrix Multiplication Operator
by BoppreH on Wednesday April 09, 2014 @12:32AM
(#7557649)
A little late, but I think the reply is worth it.
`[]` is for discrete elements. That's perfect for a tile game.
My idea with `@` is a sort of collision detection for continuous maps. `map @ (115.2, 23.5)` should return the object under that position.
This operation is useful on all sorts of interactions: "can I move there?", "what did the mouse click?", "do I have a line of sight?", etc.
I'm still thinking on how to chain those operations.
I suppose you could use it for that that, but wouldn't that be a canonical case for indexing with []?