News for hackers. Stuff that matters.
Re:First C# 7 Design Meeting Notes by phatboyslim on Wednesday January 28, 2015 @08:25AM (#8959627)
I believe c# has had tuple support since .net framework v4.
Re:First C# 7 Design Meeting Notes by mvitorino on Wednesday January 28, 2015 @09:11AM (#8959859)
I believe tuple support in v4 is a simple set of classes. There is no language construct specific for the use of tuples, which means it's just a library instead of a programming language feature.
Re:First C# 7 Design Meeting Notes by andyjohnson0 on Wednesday January 28, 2015 @09:19AM (#8959900)
What are the advantages that language-level tuples would have over the existing System.Tuple class?
Re:First C# 7 Design Meeting Notes by alkonaut on Wednesday January 28, 2015 @10:06AM (#8960170)
Without deconstruction and pattern matching, language level tuples would be only sugar: "var x = (1, 2)" versus "var x = Tuple.Create(1,2)"

The real power of Tuples only comes with deconstruction and matching, such as "var (a,b) = GetSomething()" and "case (_, y)".

So these features would go hand in hand. Deconstruction and matching requires lang level tuples, and lang level tuples are pretty lame without deconstruction and pattern matching.

Re:First C# 7 Design Meeting Notes by olavk on Wednesday January 28, 2015 @10:10AM (#8960188)
The ability to write (2, "hello") instead of Tuple.Create(2, "Hello"). But more importantly, syntax for deconstructing tuples will make tuples convenient for returning multiple values from a method. Eg.: (var x, var y) = getPoint(); as shown in the aticle.
Re:First C# 7 Design Meeting Notes by MichaelGG on Wednesday January 28, 2015 @10:06PM (#8964092)
Also, the type is simpler to represent. Instead of Tuple<int, string> you just have something like (Int, String).