Tech Off Post

Single Post Permalink

View Thread: Ideas for C# 5.0
  • Bass

    exoteric said:

    I'll start out -

     

    Tuple Syntax 
    a la (precise parenthesization not so important here)

    (1,2,3)

    Tuple Enumeration

    Not a language feature but allow tuple to be enumerated (IEnumerable<T>) for both homogeneous and heterogeneous tuples, meaning these two cases would both be legal

    foreach (var x in (1,2,3))
      Console.WriteLine(x);
    foreach (var x in (1,"WTF",3))
      Console.WriteLine(x);

    Where in the first case the tuple would be IEnumerable<int> and in the second case the tuple would be either IEnumerable<IDynamic> or IEnumerable<Object>.

    BigInt literals

     

    var bigint = 349438474346346348348346734634634892390139328234746546348349349347237236465483932948565623893832932932737;