Multiple return values, I want this in C#
I so badly want to have support for multiple return values in C# instead of using out parameters.
Note: The following is only an example, we can use a struct or an object to create a data structure which will hold the value, but I only use this code for demonstration purpose.
int x,y,z;
bool isHidden;
GetCords("MyElement", out x, out y, out z, out isHidden);
Instead of the code above, I want to do something like this:
Return 10,11,10,true;
var x,y,z,isHidden = GetCords("MyElement");
If I don’t care about the y and z return values I can instead write:
var x,,,isHidden = GetCords("MyElement");
Isn’t this beautiful?
hmm, when I’m thinking of beauty, I start to think about "The beauty is in the eye of the beholder" ;)
To confess something, the language LUA support this and I loved it when I created an add-on for World Of Warcraft.