Very very cool. What does it mean by x, y are any ranges? Do x and y have to be arrays?
Nope. Ranges are anything enumerable (can run an iterator through it by calling begin()/end() to get the boundaries), so you can do lists, arrays, generators etc.