locked
The new type Tuple is... has been ! RRS feed

  • General discussion

  • Hello,

    The type Tuple is a good idea but it's not perfect because we can't define the name of its properties.

    Therefore I think... we would make public the declaration of the anonymous type !!!

    For example :

    (int Key, string Value) o;

    define o as object of the type "(int Key, string Value)". This type is anonymous because it has not name.

    We initialise "o" with the classic code of anonymous type :

    o = new {Key = 1, Value = "cat"};

    Now we can write :

    public (int Key, string Value) MyMethod(double x)
    {
        return new {Key = 1, Value = "cat"};
    }

    This is better than "Tuple", it is not ?

    Note : Give your opinion... it's more a discussion than a question ;-)

    • Changed type ijk_ref Sunday, January 17, 2010 5:47 PM 'cause ;-)
    Sunday, January 17, 2010 10:07 AM