<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Ideas for C# 5.0</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Ideas for C# 5.0</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Wed, 19 Jun 2013 23:08:48 GMT</pubDate>
	<lastBuildDate>Wed, 19 Jun 2013 23:08:48 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>131</c9:totalResults>
	<c9:pageCount>-131</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>What would you like to see in C# 5.0?</p>
<p>&nbsp;</p>
<p>For Reference</p>
<ul>
<li><a href="http://channel9.msdn.com/shows/Going&#43;Deep/Expert-to-Expert-Anders-Hejlsberg-The-Future-of-C/">The Future of C#</a>
</li><li><a href="http://code.msdn.microsoft.com/csharpfuture/Thread/List.aspx">C# Future</a>
</li><li><a href="http://channel9.msdn.com/posts/Charles/Outstanding-Technical-Achievement-C-Team/?FlagType=Rating&amp;FlagState=1">C# Team Technical Achievement Award</a>
</li></ul>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/499699#499699</link>
		<pubDate>Sun, 18 Oct 2009 19:12:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/499699#499699</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>I'll start out -</p>
<p>&nbsp;</p>
<p><strong>Tuple Syntax</strong>&nbsp;<br>
a la&nbsp;(precise parenthesization not so important here)</p>
<blockquote><strong>(</strong>1,2,3<strong>)</strong></blockquote>
<p><strong>Tuple Enumeration</strong></p>
<p>Not a language feature but allow tuple to be enumerated (IEnumerable&lt;T&gt;) for both homogeneous and heterogeneous tuples, meaning these two cases would both be legal</p>
<blockquote>foreach (var x in (1,2,3))<br>
&nbsp;&nbsp;Console.WriteLine(x); </blockquote>
<blockquote>foreach (var x in (1,&quot;WTF&quot;,3))<br>
&nbsp;&nbsp;Console.WriteLine(x); </blockquote>
<p>Where in the first case the tuple would be IEnumerable&lt;int&gt; and in the second case the tuple would be either IEnumerable&lt;IDynamic&gt; or IEnumerable&lt;Object&gt;.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/2fc59c4c4fdd4235ad809deb00097d8b#2fc59c4c4fdd4235ad809deb00097d8b</link>
		<pubDate>Sun, 18 Oct 2009 19:24:10 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/2fc59c4c4fdd4235ad809deb00097d8b#2fc59c4c4fdd4235ad809deb00097d8b</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>I'll start out -</p>
<p>&nbsp;</p>
<p><strong>Tuple Syntax</strong>&nbsp;<br>
a la&nbsp;(precise parenthesization not so important here)</p>
<blockquote><strong>(</strong>1,2,3<strong>)</strong></blockquote>
<p><strong>Tuple Enumeration</strong></p>
<p>Not a language feature but allow tuple to be enumerated (IEnumerable&lt;T&gt;) for both homogeneous and heterogeneous tuples, meaning these two cases would both be legal</p>
<blockquote>foreach (var x in (1,2,3))<br>
&nbsp;&nbsp;Console.WriteLine(x); </blockquote>
<blockquote>foreach (var x in (1,&quot;WTF&quot;,3))<br>
&nbsp;&nbsp;Console.WriteLine(x); </blockquote>
<p>Where in the first case the tuple would be IEnumerable&lt;int&gt; and in the second case the tuple would be either IEnumerable&lt;IDynamic&gt; or IEnumerable&lt;Object&gt;.</p>
</div></blockquote>
<p>BigInt literals</p>
<p>&nbsp;</p>
<p>var bigint = 349438474346346348348346734634634892390139328234746546348349349347237236465483932948565623893832932932737;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/4783cc03b1f74951b6889deb00097db7#4783cc03b1f74951b6889deb00097db7</link>
		<pubDate>Mon, 19 Oct 2009 00:05:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/4783cc03b1f74951b6889deb00097db7#4783cc03b1f74951b6889deb00097db7</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Bass said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>BigInt literals</p>
<p>&nbsp;</p>
<p>var bigint = 349438474346346348348346734634634892390139328234746546348349349347237236465483932948565623893832932932737;</p>
</div></blockquote>
<p>Not sure that would make the cut without a suffix literal.&nbsp; But something like a &quot;B&quot; suffix would seem to fit.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7318309a3acc401fbc359deb00097ddf#7318309a3acc401fbc359deb00097ddf</link>
		<pubDate>Mon, 19 Oct 2009 01:49:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7318309a3acc401fbc359deb00097ddf#7318309a3acc401fbc359deb00097ddf</guid>
		<dc:creator>William Stacey</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/staceyw/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Range literals, e.g., 1..10 instead of Enumerable.Range(1, 10)</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/378882e8954844c1b7499deb00097e04#378882e8954844c1b7499deb00097e04</link>
		<pubDate>Mon, 19 Oct 2009 03:31:36 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/378882e8954844c1b7499deb00097e04#378882e8954844c1b7499deb00097e04</guid>
		<dc:creator>Joe Chung</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/joechung/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Bass said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>BigInt literals</p>
<p>&nbsp;</p>
<p>var bigint = 349438474346346348348346734634634892390139328234746546348349349347237236465483932948565623893832932932737;</p>
</div></blockquote>
<p>I cannot tell if this is sarcasm... <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-6.gif' alt='Sad' /> </p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f6daa21347ad479cb2399deb00097e2c#f6daa21347ad479cb2399deb00097e2c</link>
		<pubDate>Mon, 19 Oct 2009 06:52:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f6daa21347ad479cb2399deb00097e2c#f6daa21347ad479cb2399deb00097e2c</guid>
		<dc:creator>Manip</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/ManipUni/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>I'll start out -</p>
<p>&nbsp;</p>
<p><strong>Tuple Syntax</strong>&nbsp;<br>
a la&nbsp;(precise parenthesization not so important here)</p>
<blockquote><strong>(</strong>1,2,3<strong>)</strong></blockquote>
<p><strong>Tuple Enumeration</strong></p>
<p>Not a language feature but allow tuple to be enumerated (IEnumerable&lt;T&gt;) for both homogeneous and heterogeneous tuples, meaning these two cases would both be legal</p>
<blockquote>foreach (var x in (1,2,3))<br>
&nbsp;&nbsp;Console.WriteLine(x); </blockquote>
<blockquote>foreach (var x in (1,&quot;WTF&quot;,3))<br>
&nbsp;&nbsp;Console.WriteLine(x); </blockquote>
<p>Where in the first case the tuple would be IEnumerable&lt;int&gt; and in the second case the tuple would be either IEnumerable&lt;IDynamic&gt; or IEnumerable&lt;Object&gt;.</p>
</div></blockquote>
<p>I would be against tuple enumeration. A tuple is not a collection and should not be considered as such. If you really want that feature, you could build it yourself:</p>
<p></p>
<pre class="brush: csharp">public static class TupleExtensions
{
  public static IEnumerable&lt;T&gt; ToCollection&lt;T&gt;(this Tuple&lt;T, T&gt; tuple)
  {
    yield return tuple.Item1;
    yield return tuple.Item2;
  }
  
  public static IEnumerable&lt;object&gt; ToCollection&lt;T1, T2&gt;(this Tuple&lt;T1, T2&gt; tuple)
  {
    yield return tuple.Item1;
    yield return tuple.Item2;
  }

  public static IEnumerable&lt;T&gt; ToCollection&lt;T&gt;(this Tuple&lt;T, T, T&gt; tuple)
  {
    yield return tuple.Item1;
    yield return tuple.Item2;
    yield return tuple.Item3;
  }
  
  public static IEnumerable&lt;object&gt; ToCollection&lt;T1, T2, T3&gt;(this Tuple&lt;T1, T2, T3&gt; tuple)
  {
    yield return tuple.Item1;
    yield return tuple.Item2;
    yield return tuple.Item3;
  }
  
  ...
}</pre>
<p></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/66e7362e7e3f4f2591099deb00097e57#66e7362e7e3f4f2591099deb00097e57</link>
		<pubDate>Mon, 19 Oct 2009 10:29:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/66e7362e7e3f4f2591099deb00097e57#66e7362e7e3f4f2591099deb00097e57</guid>
		<dc:creator>Tommy Carlier</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/TommyCarlier/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">TommyCarlier said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I would be against tuple enumeration. A tuple is not a collection and should not be considered as such. If you really want that feature, you could build it yourself:</p>
<p></p>
<pre class="brush: csharp">public static class TupleExtensions
{
  public static IEnumerable&lt;T&gt; ToCollection&lt;T&gt;(this Tuple&lt;T, T&gt; tuple)
  {
    yield return tuple.Item1;
    yield return tuple.Item2;
  }
  
  public static IEnumerable&lt;object&gt; ToCollection&lt;T1, T2&gt;(this Tuple&lt;T1, T2&gt; tuple)
  {
    yield return tuple.Item1;
    yield return tuple.Item2;
  }

  public static IEnumerable&lt;T&gt; ToCollection&lt;T&gt;(this Tuple&lt;T, T, T&gt; tuple)
  {
    yield return tuple.Item1;
    yield return tuple.Item2;
    yield return tuple.Item3;
  }
  
  public static IEnumerable&lt;object&gt; ToCollection&lt;T1, T2, T3&gt;(this Tuple&lt;T1, T2, T3&gt; tuple)
  {
    yield return tuple.Item1;
    yield return tuple.Item2;
    yield return tuple.Item3;
  }
  
  ...
}</pre>
<p></p>
</div></blockquote>
<p>A tuple <em>is </em>a collection. It's just a heterogeneous collection where elements do not always have the same type. That said, using extension methods for tuple enumeration could be a pretty good midpoint between no support and built-in support.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f12a8b941b464d9984c99deb00097e80#f12a8b941b464d9984c99deb00097e80</link>
		<pubDate>Mon, 19 Oct 2009 10:46:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f12a8b941b464d9984c99deb00097e80#f12a8b941b464d9984c99deb00097e80</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>REPLs.&nbsp; The demo just left me wanting for the days of BASIC on my TRS-80 when the command-line (if you can call it that) and the code felt interchangeable.&nbsp; Doesn't seem all that useful, but really fun.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/fc93988f9c1c423a9c7b9deb00097ea6#fc93988f9c1c423a9c7b9deb00097ea6</link>
		<pubDate>Mon, 19 Oct 2009 11:04:10 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/fc93988f9c1c423a9c7b9deb00097ea6#fc93988f9c1c423a9c7b9deb00097ea6</guid>
		<dc:creator>tsilb</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SlackmasterK/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>I think first class tuples would be useful, I would imagine extension properties make it in as its been noted that they actually agreed on a specification for how to do it, just had to cut it for 4.0 in order to shipit.</p>
<p>&nbsp;</p>
<p>Not sure about enumeration, a tuple is only a sequence in a syntactic sense, theres plenty of contexts for how you can iterate something, and I think there needs to be proper thought into what should be considered a native sequence to the language.. best
 bet is, does it really add anything? no, then its not worth introducing additional behavior.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/5b9690ac8276475a86059deb00097ece#5b9690ac8276475a86059deb00097ece</link>
		<pubDate>Mon, 19 Oct 2009 11:52:36 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/5b9690ac8276475a86059deb00097ece#5b9690ac8276475a86059deb00097ece</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>I'll start out -</p>
<p>&nbsp;</p>
<p><strong>Tuple Syntax</strong>&nbsp;<br>
a la&nbsp;(precise parenthesization not so important here)</p>
<blockquote><strong>(</strong>1,2,3<strong>)</strong></blockquote>
<p><strong>Tuple Enumeration</strong></p>
<p>Not a language feature but allow tuple to be enumerated (IEnumerable&lt;T&gt;) for both homogeneous and heterogeneous tuples, meaning these two cases would both be legal</p>
<blockquote>foreach (var x in (1,2,3))<br>
&nbsp;&nbsp;Console.WriteLine(x); </blockquote>
<blockquote>foreach (var x in (1,&quot;WTF&quot;,3))<br>
&nbsp;&nbsp;Console.WriteLine(x); </blockquote>
<p>Where in the first case the tuple would be IEnumerable&lt;int&gt; and in the second case the tuple would be either IEnumerable&lt;IDynamic&gt; or IEnumerable&lt;Object&gt;.</p>
</div></blockquote>
<p>I'll agree with tuple syntax, but the (1, 2, 3) stuff isn't the important part. What's much more important is tuple assignment.</p>
<p>&nbsp;</p>
<p>int a, b, c;</p>
<p>(a, b, c) = TupleReturningMethod();</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1fd667aca03043e1be389deb00097ef7#1fd667aca03043e1be389deb00097ef7</link>
		<pubDate>Mon, 19 Oct 2009 14:05:08 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1fd667aca03043e1be389deb00097ef7#1fd667aca03043e1be389deb00097ef7</guid>
		<dc:creator>William Kempf</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/wkempf/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">wkempf said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I'll agree with tuple syntax, but the (1, 2, 3) stuff isn't the important part. What's much more important is tuple assignment.</p>
<p>&nbsp;</p>
<p>int a, b, c;</p>
<p>(a, b, c) = TupleReturningMethod();</p>
</div></blockquote>
<p>I'll buy that for a dollar. I really liked that way of &quot;decomposing&quot; a tuple when using SML. Both are ways to make programs shorter because ultimately you don't need it, just as you don't need foreach.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/cfa76202ced74c779d3c9deb00097f1e#cfa76202ced74c779d3c9deb00097f1e</link>
		<pubDate>Mon, 19 Oct 2009 14:21:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/cfa76202ced74c779d3c9deb00097f1e#cfa76202ced74c779d3c9deb00097f1e</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>I Would love to have partial publishing facility in website model applications, if there is an ASP.Net release</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c75baf6472e3430db1e89deb00097f63#c75baf6472e3430db1e89deb00097f63</link>
		<pubDate>Mon, 19 Oct 2009 15:14:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c75baf6472e3430db1e89deb00097f63#c75baf6472e3430db1e89deb00097f63</guid>
		<dc:creator>Tech Chaser</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/TechChaser/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">TechChaser said:</div><div class="quoteText">
<p>I Would love to have partial publishing facility in website model applications, if there is an ASP.Net release</p>
</div></blockquote>
<p>I think this thread is specifically about language features, in terms of .net features, I'd love to see some work put into making compilation more extensible (like postsharp for example)..</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/bf79974374b240a68cb99deb00097f8c#bf79974374b240a68cb99deb00097f8c</link>
		<pubDate>Mon, 19 Oct 2009 15:32:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/bf79974374b240a68cb99deb00097f8c#bf79974374b240a68cb99deb00097f8c</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">stevo_ said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">TechChaser said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I think this thread is specifically about language features, in terms of .net features, I'd love to see some work put into making compilation more extensible (like postsharp for example)..</p>
</div></blockquote>
<p>Yeah, it would be interesting to see an application go through some programatic transform before compilation.&nbsp; Something a bit more powerful than the simple #if(DEBUG) ugliness.&nbsp; Maybe along the lines of a Linq to Parse Tree, or Linq to Assembly, or Linq
 to Attributes.&nbsp; ie, you could have your precompiler set up with a set of Linq expressions, and if you wanted to do a core compile, you would choose the one that removed all the [UI]-decorated classes and methods.</p>
<p>&nbsp;</p>
<p>That would also allow a lot more flexibility for encapsulation and information hiding than the current five access specifiers, and would enable things like friend classes without explicitly adding friend classes.&nbsp; ie, the Linq code could specify that classes
 decorated with [Tester] would have access to all methods decorated [Testable], but that no other classes would be able to see it.&nbsp; That would allow the &quot;architects&quot; to create the attributes and write the Linq code to determine what is visible to what, while
 the application programmers simply create classes to work within those boundaries.</p>
<p>&nbsp;</p>
<p>Something like a formal, compilable version of a standards document.</p>
<p>&nbsp;</p>
<p>Another nice thing about doing things this way is that you gain the power of doing macro-type stuff, but since everything is just a Linq-to-Parse-Tree, it would be analyzable realtime to the editor and intellisense (just like the #if(DEBUG) is now).</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/579721445d494ee1b0919deb00097fd4#579721445d494ee1b0919deb00097fd4</link>
		<pubDate>Tue, 20 Oct 2009 03:29:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/579721445d494ee1b0919deb00097fd4#579721445d494ee1b0919deb00097fd4</guid>
		<dc:creator>Dax Fohl</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/daxfohl/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>I want to have &quot;endif&quot; </p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/ac24874ac13941e28e269deb00097ffa#ac24874ac13941e28e269deb00097ffa</link>
		<pubDate>Tue, 20 Oct 2009 16:53:29 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/ac24874ac13941e28e269deb00097ffa#ac24874ac13941e28e269deb00097ffa</guid>
		<dc:creator>Minh</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Minh/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">staceyw said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Bass said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Not sure that would make the cut without a suffix literal.&nbsp; But something like a &quot;B&quot; suffix would seem to fit.</p>
</div></blockquote>
<p>There is no suffix literal for Int32 and Int64, try doing a var on a literal over 3 billion in value, the compiler will automatically define it as an Int64.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7f942c0a8824493faf9f9deb00098022#7f942c0a8824493faf9f9deb00098022</link>
		<pubDate>Tue, 20 Oct 2009 16:56:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7f942c0a8824493faf9f9deb00098022#7f942c0a8824493faf9f9deb00098022</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Bass said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">staceyw said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>There is no suffix literal for Int32 and Int64, try doing a var on a literal over 3 billion in value, the compiler will automatically define it as an Int64.</p>
</div></blockquote>
<p></p>
<pre class="brush: csharp">var i = 123L; // the type of i is long/Int64</pre>
<p></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/fd48a3e83fa648fc8c859deb0009804a#fd48a3e83fa648fc8c859deb0009804a</link>
		<pubDate>Tue, 20 Oct 2009 17:53:54 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/fd48a3e83fa648fc8c859deb0009804a#fd48a3e83fa648fc8c859deb0009804a</guid>
		<dc:creator>Tommy Carlier</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/TommyCarlier/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Minh said:</div><div class="quoteText">
<p>I want to have &quot;endif&quot; </p>
</div></blockquote>
<p>Is this a serious suggestion?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e07e48204093472db9ff9deb00098073#e07e48204093472db9ff9deb00098073</link>
		<pubDate>Tue, 20 Oct 2009 18:36:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e07e48204093472db9ff9deb00098073#e07e48204093472db9ff9deb00098073</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">TommyCarlier said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Bass said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p></p>
<pre class="brush: csharp">var i = 123L; // the type of i is long/Int64</pre>
<p></p>
</div></blockquote>
<p>I ment to say that the compiler can figure out if a literal should be an Int32 or Int64 based on it's size. My bad.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/2faadb9dd7ad4881b9e69deb0009809a#2faadb9dd7ad4881b9e69deb0009809a</link>
		<pubDate>Tue, 20 Oct 2009 19:24:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/2faadb9dd7ad4881b9e69deb0009809a#2faadb9dd7ad4881b9e69deb0009809a</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">stevo_ said:</div><div class="quoteText">
<p>I think first class tuples would be useful, I would imagine extension properties make it in as its been noted that they actually agreed on a specification for how to do it, just had to cut it for 4.0 in order to shipit.</p>
<p>&nbsp;</p>
<p>Not sure about enumeration, a tuple is only a sequence in a syntactic sense, theres plenty of contexts for how you can iterate something, and I think there needs to be proper thought into what should be considered a native sequence to the language.. best
 bet is, does it really add anything? no, then its not worth introducing additional behavior.</p>
</div></blockquote>
<p>IIRC they decided the specification was the wrong thing and to go back to the drawing board.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/cd6d22d6b7f3482596b29deb000980c3#cd6d22d6b7f3482596b29deb000980c3</link>
		<pubDate>Wed, 21 Oct 2009 05:34:33 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/cd6d22d6b7f3482596b29deb000980c3#cd6d22d6b7f3482596b29deb000980c3</guid>
		<dc:creator>contextfree</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/contextfree/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">stevo_ said:</div><div class="quoteText">
<p>I think first class tuples would be useful, I would imagine extension properties make it in as its been noted that they actually agreed on a specification for how to do it, just had to cut it for 4.0 in order to shipit.</p>
<p>&nbsp;</p>
<p>Not sure about enumeration, a tuple is only a sequence in a syntactic sense, theres plenty of contexts for how you can iterate something, and I think there needs to be proper thought into what should be considered a native sequence to the language.. best
 bet is, does it really add anything? no, then its not worth introducing additional behavior.</p>
</div></blockquote>
<p>It adds composability (direct use of tuples for LINQ) - but you're right, it needs to be thought out if there are costs involved, conflict cases - and whether to only allow it for homogeneous tuples: for this case what would be wrong, I don't see anything.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/dacf62375b2a45dbad4d9deb000980eb#dacf62375b2a45dbad4d9deb000980eb</link>
		<pubDate>Wed, 21 Oct 2009 07:24:14 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/dacf62375b2a45dbad4d9deb000980eb#dacf62375b2a45dbad4d9deb000980eb</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>More complex data structures, such as R-Tree's</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7a3337b3fd85420087319deb00098111#7a3337b3fd85420087319deb00098111</link>
		<pubDate>Thu, 22 Oct 2009 06:49:30 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7a3337b3fd85420087319deb00098111#7a3337b3fd85420087319deb00098111</guid>
		<dc:creator>Maddus Mattus</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Maddus Mattus/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Maddus Mattus said:</div><div class="quoteText">
<p>More complex data structures, such as R-Tree's</p>
</div></blockquote>
<p>As a language feature?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c39ce0e56a2e4f7baa6e9deb00098137#c39ce0e56a2e4f7baa6e9deb00098137</link>
		<pubDate>Thu, 22 Oct 2009 08:27:26 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c39ce0e56a2e4f7baa6e9deb00098137#c39ce0e56a2e4f7baa6e9deb00098137</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">stevo_ said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Maddus Mattus said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>As a language feature?</p>
</div></blockquote>
<p>yeah, you are right. It would make it a .Net 5.0 feature not a language feature.</p>
<p>&nbsp;</p>
<p>But I would still like it <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/15bfd25968844fe9a5f19deb0009815e#15bfd25968844fe9a5f19deb0009815e</link>
		<pubDate>Thu, 22 Oct 2009 13:31:50 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/15bfd25968844fe9a5f19deb0009815e#15bfd25968844fe9a5f19deb0009815e</guid>
		<dc:creator>Maddus Mattus</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Maddus Mattus/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>First class dependency objects and properties;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public dependency class Person
{
	public dependency string Name 
	{ 
		get;
		set; 
		default { return &quot;John Doe&quot;; }
		change { Console.WriteLine(&quot;Old: {0}, New: {1}&quot;, oldvalue, newvalue); }
	}
}</pre>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>instead of</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public class Person: DependencyObject
{
	public static readonly DependencyProperty NameProperty = DependencyProperty.Register(
		&quot;Name&quot;, typeof(string), typeof(Person), new PropertyMetadata(&quot;John Doe&quot;, OnNameChanged));
	
	private static void OnNameChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
	{
		((Person)sender).OnNameChanged((string)args.OldValue, (string)args.NewValue);
	}
 
	public string Name
	{
		get { return (string)GetValue(NameProperty); }
		set { SetValue(NameProperty, value); }
	}
	private void OnNameChanged(string oldvalue, string newvalue)
	{
		Console.WriteLine(&quot;Old: {0}, New {1}&quot;, oldvalue, newvalue);
	}
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Would be nice if something like this could also work with INotifyPropertyChanged, IDataErrorInfo and IEditableObject.</p>
<p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/d2e3e25943c0482881bd9deb000981a4#d2e3e25943c0482881bd9deb000981a4</link>
		<pubDate>Fri, 23 Oct 2009 12:25:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/d2e3e25943c0482881bd9deb000981a4#d2e3e25943c0482881bd9deb000981a4</guid>
		<dc:creator>Vriff Polo</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Vriff Polo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Vriff Polo said:</div><div class="quoteText">
<p>First class dependency objects and properties;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public dependency class Person
{
	public dependency string Name 
	{ 
		get;
		set; 
		default { return &quot;John Doe&quot;; }
		change { Console.WriteLine(&quot;Old: {0}, New: {1}&quot;, oldvalue, newvalue); }
	}
}</pre>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>instead of</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public class Person: DependencyObject
{
	public static readonly DependencyProperty NameProperty = DependencyProperty.Register(
		&quot;Name&quot;, typeof(string), typeof(Person), new PropertyMetadata(&quot;John Doe&quot;, OnNameChanged));
	
	private static void OnNameChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
	{
		((Person)sender).OnNameChanged((string)args.OldValue, (string)args.NewValue);
	}
 
	public string Name
	{
		get { return (string)GetValue(NameProperty); }
		set { SetValue(NameProperty, value); }
	}
	private void OnNameChanged(string oldvalue, string newvalue)
	{
		Console.WriteLine(&quot;Old: {0}, New {1}&quot;, oldvalue, newvalue);
	}
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Would be nice if something like this could also work with INotifyPropertyChanged, IDataErrorInfo and IEditableObject.</p>
<p>&nbsp;</p>
</div></blockquote>
<p>There is a lot of activity around dependency injection, dependency properties etc. I wonder if they really constitute the way of the future especially with Rx on the horizon. Hmm...</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/368d479387a14615a2fc9deb000981cd#368d479387a14615a2fc9deb000981cd</link>
		<pubDate>Fri, 23 Oct 2009 16:20:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/368d479387a14615a2fc9deb000981cd#368d479387a14615a2fc9deb000981cd</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Dependency injection is really a different concept to the dependency system wpf and wf use, I don't think you really intend for the dependency system to be part of the core language feature, its really pretty specific.. I think you may be more interested
 in something more like 'first class properties', where you could pass around a property as an object, and be able to do more sophisticated things by default, such as change notifications and binding.</p>
<p>&nbsp;</p>
<p>I think this is something too specific for a language feature personally, but its something that could be implemented by a library if we had a standard way to do post compilation weaving like postsharp does.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c1c5bfcdf85e40f78a819deb000981f5#c1c5bfcdf85e40f78a819deb000981f5</link>
		<pubDate>Fri, 23 Oct 2009 18:16:46 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c1c5bfcdf85e40f78a819deb000981f5#c1c5bfcdf85e40f78a819deb000981f5</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Tuples, ct'd</p>
<p>&nbsp;</p>
<p>A progression of signal amplifications&nbsp;vis-à-vis noise reductions</p>
<p></p>
<pre class="brush: csharp">// absolute noise
Tuple&lt;int, int&gt; Abs(int x, int y)
{
    return Tuple.Create(Math.Abs(x), Math.Abs(y));
}
// less noise
(int, int) Abs(int x, int y)
{
    return (Math.Abs(x), Math.Abs(y));
}
// less noise still
(int, int) Abs (int x, int y)
{
    return Math.Abs(x), Math.Abs(y);
}
void test()
{
    // full noise
    Abs Tuple.Create(1, -1)
    // less noise
    Abs (1, -1)
}
</pre>
<p></p>
<p>In particular, this</p>
<p></p>
<pre class="brush: csharp">void test()
{
    Abs (1, -1)
}
</pre>
<p></p>
<p>should also match up with this</p>
<p></p>
<pre class="brush: csharp">Tuple&lt;int, int&gt; Abs(Tuple&lt;int, int&gt; p)
{
    return Tuple.Create(Math.Abs(p.Item1), Math.Abs(p.Item2));
}
</pre>
<p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e122e3e52867468795b89deb0009821f#e122e3e52867468795b89deb0009821f</link>
		<pubDate>Sun, 25 Oct 2009 12:17:40 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e122e3e52867468795b89deb0009821f#e122e3e52867468795b89deb0009821f</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Clearly this is nver going to happen but....</p>
<p>&nbsp;</p>
<p>... what about saying &quot;you know, we did a really good job on c# 4.0, so lets leave it for a while and instead of adding new features right away, lets see if we can look to adding stuff in five years time.&quot;</p>
<p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9986bb30633440fcb2829deb00098261#9986bb30633440fcb2829deb00098261</link>
		<pubDate>Mon, 26 Oct 2009 12:59:00 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9986bb30633440fcb2829deb00098261#9986bb30633440fcb2829deb00098261</guid>
		<dc:creator>silverfrost</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/silverfrost/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">silverfrost said:</div><div class="quoteText">
<p>Clearly this is nver going to happen but....</p>
<p>&nbsp;</p>
<p>... what about saying &quot;you know, we did a really good job on c# 4.0, so lets leave it for a while and instead of adding new features right away, lets see if we can look to adding stuff in five years time.&quot;</p>
<p>&nbsp;</p>
</div></blockquote>
<p>Problem is, the world doesn't stand still just because you do. Witness Java-land and the great Scala. Not evolving is loosing.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/60ca3fc4dd3342dbad309deb00098289#60ca3fc4dd3342dbad309deb00098289</link>
		<pubDate>Mon, 26 Oct 2009 19:39:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/60ca3fc4dd3342dbad309deb00098289#60ca3fc4dd3342dbad309deb00098289</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Unnullability a la</p>
<p></p>
<pre class="brush: csharp">    public struct Unnullable&lt;T&gt; where T : class
    {
        public Unnullable(T x)
        {
            if (x == null)
                throw new NullReferenceException();
            item = x;
        }
        public T Item
        {
            get
            {
                return item;
            }
        }
        private readonly T item;
    }
</pre>
<p></p>
<p>and used as such</p>
<p></p>
<pre class="brush: csharp">    class Foo
    {
        int Bar = 3;
    }
    class Program
    {
        static void Main(string[] args)
        {
            var ufoo = new Unnullable&lt;Foo&gt;(new Foo());
            Console.WriteLine(ufoo.Item);
            Unnullable&lt;Foo&gt; baz; // error
            Unnullable&lt;Foo&gt; bax = null; // error
            Unnullable&lt;Foo&gt; box = (Foo)null; // error
            Console.ReadKey();
        }
    }
</pre>
<p></p>
<p>with built-in compiler support so we can simply write</p>
<p></p>
<pre class="brush: csharp">var ufoo = new Foo!(); // type of ufoo is Foo! =&gt; Unnullable&lt;Foo&gt; 
Console.WriteLine(ufoo.bar);</pre>
<p></p>
<p>Even without compiler support it will help catch nullness errors because in this case the compiler just translates ! to Unnullable - a kind of dual of ? which translates to Nullable. And with compiler support you may not even need to explicitly implement
 as Unnullable&lt;T&gt; although it will probably make the implementation easier.</p>
<p>&nbsp;</p>
<p>And of course unnullable classes - where by default the class is unnullable.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/bee3f61ec3d94b6baa9d9deb000982b4#bee3f61ec3d94b6baa9d9deb000982b4</link>
		<pubDate>Tue, 27 Oct 2009 06:03:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/bee3f61ec3d94b6baa9d9deb000982b4#bee3f61ec3d94b6baa9d9deb000982b4</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>It may seem a not very ambitious request, but what I would like to see in C# is the ability to declare variables in&nbsp;the guard expression of some statements. Some usage examples:</p>
<p>&nbsp;</p>
<p>while ((int&nbsp;bytesRead&nbsp;= stream.Read (buffer, 0, buffer.Length)) &gt; 0) {</p>
<p>&nbsp;&nbsp; outStream.Write (buffer, 0, bytesRead);</p>
<p>}</p>
<p>&nbsp;</p>
<p>if ((IDisposable d = someObject as IDisposable) != null) {</p>
<p>&nbsp; d.Dispose ();</p>
<p>} else {</p>
<p>&nbsp; Console.WriteLine(&quot;Cannot dispose objects of type {0}&quot;, d.GetType().Name);</p>
<p>}</p>
<p>&nbsp;</p>
<p>switch (char c = charReader.ReadChar()) {</p>
<p>&nbsp; case 'a':</p>
<p>&nbsp; case 'b':&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; return c;</p>
<p>&nbsp; }</p>
<p>&nbsp;</p>
<p>&nbsp; ...</p>
<p>}</p>
<p>&nbsp;</p>
<p>It would prevent some&nbsp;name pollution and make porting code from C/C&#43;&#43; easier.</p>
<p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/16cd1003b9584a028d469deb000982fa#16cd1003b9584a028d469deb000982fa</link>
		<pubDate>Tue, 27 Oct 2009 19:35:19 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/16cd1003b9584a028d469deb000982fa#16cd1003b9584a028d469deb000982fa</guid>
		<dc:creator>Blue Ink</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Blue Ink/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Blue Ink said:</div><div class="quoteText">
<p>It may seem a not very ambitious request, but what I would like to see in C# is the ability to declare variables in&nbsp;the guard expression of some statements. Some usage examples:</p>
<p>&nbsp;</p>
<p>while ((int&nbsp;bytesRead&nbsp;= stream.Read (buffer, 0, buffer.Length)) &gt; 0) {</p>
<p>&nbsp;&nbsp; outStream.Write (buffer, 0, bytesRead);</p>
<p>}</p>
<p>&nbsp;</p>
<p>if ((IDisposable d = someObject as IDisposable) != null) {</p>
<p>&nbsp; d.Dispose ();</p>
<p>} else {</p>
<p>&nbsp; Console.WriteLine(&quot;Cannot dispose objects of type {0}&quot;, d.GetType().Name);</p>
<p>}</p>
<p>&nbsp;</p>
<p>switch (char c = charReader.ReadChar()) {</p>
<p>&nbsp; case 'a':</p>
<p>&nbsp; case 'b':&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; return c;</p>
<p>&nbsp; }</p>
<p>&nbsp;</p>
<p>&nbsp; ...</p>
<p>}</p>
<p>&nbsp;</p>
<p>It would prevent some&nbsp;name pollution and make porting code from C/C&#43;&#43; easier.</p>
<p>&nbsp;</p>
</div></blockquote>
<p>Doesn't seem too bad although I'd be cautious about importing C&#43;&#43; coding practices into C#.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/8686224b9d484e14ae6b9deb00098327#8686224b9d484e14ae6b9deb00098327</link>
		<pubDate>Wed, 28 Oct 2009 21:06:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/8686224b9d484e14ae6b9deb00098327#8686224b9d484e14ae6b9deb00098327</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>Unnullability a la</p>
<p></p>
<pre class="brush: csharp">    public struct Unnullable&lt;T&gt; where T : class
    {
        public Unnullable(T x)
        {
            if (x == null)
                throw new NullReferenceException();
            item = x;
        }
        public T Item
        {
            get
            {
                return item;
            }
        }
        private readonly T item;
    }
</pre>
<p></p>
<p>and used as such</p>
<p></p>
<pre class="brush: csharp">    class Foo
    {
        int Bar = 3;
    }
    class Program
    {
        static void Main(string[] args)
        {
            var ufoo = new Unnullable&lt;Foo&gt;(new Foo());
            Console.WriteLine(ufoo.Item);
            Unnullable&lt;Foo&gt; baz; // error
            Unnullable&lt;Foo&gt; bax = null; // error
            Unnullable&lt;Foo&gt; box = (Foo)null; // error
            Console.ReadKey();
        }
    }
</pre>
<p></p>
<p>with built-in compiler support so we can simply write</p>
<p></p>
<pre class="brush: csharp">var ufoo = new Foo!(); // type of ufoo is Foo! =&gt; Unnullable&lt;Foo&gt; 
Console.WriteLine(ufoo.bar);</pre>
<p></p>
<p>Even without compiler support it will help catch nullness errors because in this case the compiler just translates ! to Unnullable - a kind of dual of ? which translates to Nullable. And with compiler support you may not even need to explicitly implement
 as Unnullable&lt;T&gt; although it will probably make the implementation easier.</p>
<p>&nbsp;</p>
<p>And of course unnullable classes - where by default the class is unnullable.</p>
</div></blockquote>
<p>The real performance benefits from this [null checks] come in at the MSIL level, unfortunately, so spec# etc. is the only way to go. None of this namby-pamby, prittle-pattle, tittle-tattle type nonesense.</p>
<p>&nbsp;</p>
<p>With regard to dependency injection, I think Prism is leading the way here, and from a library point of view, it makes sense and the team has really done a fantastic job. If you gave me the cash and the staff to build a high-class, modern application, Prism
 would be at the top of my list.</p>
<p>&nbsp;</p>
<p>With regard to extension methods, you could pick a handful of your favorite static libraries, MessageBox.Show, Regex even Code Contracts and add them to your list. This will widen the scope for method name clashes, so i'm sure the BCL team will resist this
 somewhat.</p>
<p>&nbsp;</p>
<p>Thats not to say there isn't some perspicacious thinking going on here, because there is.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a1e72190d055496981229deb00098354#a1e72190d055496981229deb00098354</link>
		<pubDate>Wed, 28 Oct 2009 21:34:16 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a1e72190d055496981229deb00098354#a1e72190d055496981229deb00098354</guid>
		<dc:creator>Vesuvius</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/vesuvius/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">vesuvius said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>The real performance benefits from this [null checks] come in at the MSIL level, unfortunately, so spec# etc. is the only way to go. None of this namby-pamby, prittle-pattle, tittle-tattle type nonesense.</p>
<p>&nbsp;</p>
<p>With regard to dependency injection, I think Prism is leading the way here, and from a library point of view, it makes sense and the team has really done a fantastic job. If you gave me the cash and the staff to build a high-class, modern application, Prism
 would be at the top of my list.</p>
<p>&nbsp;</p>
<p>With regard to extension methods, you could pick a handful of your favorite static libraries, MessageBox.Show, Regex even Code Contracts and add them to your list. This will widen the scope for method name clashes, so i'm sure the BCL team will resist this
 somewhat.</p>
<p>&nbsp;</p>
<p>Thats not to say there isn't some perspicacious thinking going on here, because there is.</p>
</div></blockquote>
<p>I'm quite curious as to how you'd create a more efficient representation than a struct wrapping a reference type, please elaborate.</p>
<p>&nbsp;</p>
<p>Actually this is not about performance at all, it is about correctness.</p>
<p>&nbsp;</p>
<p>I'm not very familiar with Spec# but believe it has syntax support for non-nullability. Does Spec# not use the off-the-shelf CLR?</p>
<p>&nbsp;</p>
<p>As to extension methods, that's a different thread, this is about C# 5.0 ideas (but would welcome any discussion about anti-patterns there; I don't think Contract makes sense as an extension method cluster at all; it does make sense, however, to lift the
 methods out to be accessible without name qualification; MessageBox.Show, I don't know about that one; - but let's have that discussion in the other thread).</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/dfa81b6c7bf0469f904e9deb0009837f#dfa81b6c7bf0469f904e9deb0009837f</link>
		<pubDate>Wed, 28 Oct 2009 21:44:15 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/dfa81b6c7bf0469f904e9deb0009837f#dfa81b6c7bf0469f904e9deb0009837f</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">vesuvius said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>The real performance benefits from this [null checks] come in at the MSIL level, unfortunately, so spec# etc. is the only way to go. None of this namby-pamby, prittle-pattle, tittle-tattle type nonesense.</p>
<p>&nbsp;</p>
<p>With regard to dependency injection, I think Prism is leading the way here, and from a library point of view, it makes sense and the team has really done a fantastic job. If you gave me the cash and the staff to build a high-class, modern application, Prism
 would be at the top of my list.</p>
<p>&nbsp;</p>
<p>With regard to extension methods, you could pick a handful of your favorite static libraries, MessageBox.Show, Regex even Code Contracts and add them to your list. This will widen the scope for method name clashes, so i'm sure the BCL team will resist this
 somewhat.</p>
<p>&nbsp;</p>
<p>Thats not to say there isn't some perspicacious thinking going on here, because there is.</p>
</div></blockquote>
<p>By prism you mean unity? unity is ok but its really an entry level ioc.. in terms of pure di I think windsor and MEF are worth looking at.</p>
<p>&nbsp;</p>
<p>Windsor is a much more mature and capable&nbsp;ioc, and mef is more focused on different types of di.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f3bcad6841f448ebb9c29deb000983a9#f3bcad6841f448ebb9c29deb000983a9</link>
		<pubDate>Wed, 28 Oct 2009 22:33:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f3bcad6841f448ebb9c29deb000983a9#f3bcad6841f448ebb9c29deb000983a9</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">vesuvius said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I'm quite curious as to how you'd create a more efficient representation than a struct wrapping a reference type, please elaborate.</p>
<p>&nbsp;</p>
<p>Actually this is not about performance at all, it is about correctness.</p>
<p>&nbsp;</p>
<p>I'm not very familiar with Spec# but believe it has syntax support for non-nullability. Does Spec# not use the off-the-shelf CLR?</p>
<p>&nbsp;</p>
<p>As to extension methods, that's a different thread, this is about C# 5.0 ideas (but would welcome any discussion about anti-patterns there; I don't think Contract makes sense as an extension method cluster at all; it does make sense, however, to lift the
 methods out to be accessible without name qualification; MessageBox.Show, I don't know about that one; - but let's have that discussion in the other thread).</p>
</div></blockquote>
<p>I like your idea. I'd extend it to say I think .NET should have used non-nullable types by default. But it's probably too late for that. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-6.gif' alt='Sad' /></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/31066dcb4c2b4a259e819deb000983d3#31066dcb4c2b4a259e819deb000983d3</link>
		<pubDate>Wed, 28 Oct 2009 22:34:17 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/31066dcb4c2b4a259e819deb000983d3#31066dcb4c2b4a259e819deb000983d3</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Bass said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I like your idea. I'd extend it to say I think .NET should have used non-nullable types by default. But it's probably too late for that.
<img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-6.gif" alt="Sad"></p>
</div></blockquote>
<p>It's the same with mutable vs immutable - we're finding that the defaults are wrong</p>
<p>&nbsp;</p>
<p>- mutable vs immutable by default</p>
<p>- nullable vs unnullable by default</p>
<p>- imperative vs declarative by default</p>
<p>&nbsp;</p>
<p>really, all these choices steer you toward the functional paradigm but not necessarily without object-orientation (Scala, and less so, F#)</p>
<p>&nbsp;</p>
<p>but it's actually not too late to reverse the situation in C# - consider this</p>
<p>&nbsp;</p>
<p>val x = 3; // immutable by default - type-inferred; doesn't imply out-lawing &quot;var&quot; but does begin a movement towards a saner default (well, actually, within a single method, if side-effects are constrained to it, supposedly it doesn't matter for purity;
 still, val would be nice; and this doesn't mean transitively immutable - each type would still need to be implemented as immutable)</p>
<p>&nbsp;</p>
<p>immutable unnullable class&nbsp;Person ... // self-evident, if bloated - but bloat at definition site is better than bloat at use site</p>
<p>&nbsp;</p>
<p>or -</p>
<p>&nbsp;</p>
<p>invariant class Person ... // as above</p>
<p>&nbsp;</p>
<p>or -</p>
<p>&nbsp;</p>
<p>immutable class Person! ... // as above</p>
<p>&nbsp;</p>
<p>Strip away some paths of expression (implicit nullability, implicit mutability, implicit side-effects) and you give the compiler greater (or at least easier access to) freedom to do radical program transformation. I'd like to think that's where we're going...</p>
<p>&nbsp;</p>
<p>One thing is reversing the present. Another is reversing the (sins of the) past - also known as the .Net Framework... But that reversal probably begins with a more principled C#.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1b906d70e3b048fd945e9deb000983ff#1b906d70e3b048fd945e9deb000983ff</link>
		<pubDate>Wed, 28 Oct 2009 22:51:45 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1b906d70e3b048fd945e9deb000983ff#1b906d70e3b048fd945e9deb000983ff</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">stevo_ said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">vesuvius said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>By prism you mean unity? unity is ok but its really an entry level ioc.. in terms of pure di I think windsor and MEF are worth looking at.</p>
<p>&nbsp;</p>
<p>Windsor is a much more mature and capable&nbsp;ioc, and mef is more focused on different types of di.</p>
</div></blockquote>
<p>Is there no one DI/F to rule them all? If we have several DI/Fs will they compose? Is this a sustainable path?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/97d3d7ef078944118fc29deb00098429#97d3d7ef078944118fc29deb00098429</link>
		<pubDate>Wed, 28 Oct 2009 23:06:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/97d3d7ef078944118fc29deb00098429#97d3d7ef078944118fc29deb00098429</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">stevo_ said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Is there no one DI/F to rule them all? If we have several DI/Fs will they compose? Is this a sustainable path?</p>
</div></blockquote>
<p>Like anything I think its probably a good and realistic thing that there isn't a single great one, windsor is pretty solid though.. but it focuses more on the ioc aspects.. in terms of raw dependency injection.. ie- I have a service A, which requires service
 B.. then MEF is offers more choices of resolution aspects.</p>
<p>&nbsp;</p>
<p>You could well today use both mef and something like windsor but I don't think they would align exactly.. I think that MEF may gain more ioc like features in upcoming releases, and become something close to a 'fantastic all rounder' for awhile.</p>
<p>&nbsp;</p>
<p>These days I use windsor, but I don't really think any ioc frameworks are really meeting a modern requirement.. mef has stable composition which I think should be something iocs should look into providing as an option.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/95e077de72954c4683949deb00098452#95e077de72954c4683949deb00098452</link>
		<pubDate>Wed, 28 Oct 2009 23:50:36 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/95e077de72954c4683949deb00098452#95e077de72954c4683949deb00098452</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Bass said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>It's the same with mutable vs immutable - we're finding that the defaults are wrong</p>
<p>&nbsp;</p>
<p>- mutable vs immutable by default</p>
<p>- nullable vs unnullable by default</p>
<p>- imperative vs declarative by default</p>
<p>&nbsp;</p>
<p>really, all these choices steer you toward the functional paradigm but not necessarily without object-orientation (Scala, and less so, F#)</p>
<p>&nbsp;</p>
<p>but it's actually not too late to reverse the situation in C# - consider this</p>
<p>&nbsp;</p>
<p>val x = 3; // immutable by default - type-inferred; doesn't imply out-lawing &quot;var&quot; but does begin a movement towards a saner default (well, actually, within a single method, if side-effects are constrained to it, supposedly it doesn't matter for purity;
 still, val would be nice; and this doesn't mean transitively immutable - each type would still need to be implemented as immutable)</p>
<p>&nbsp;</p>
<p>immutable unnullable class&nbsp;Person ... // self-evident, if bloated - but bloat at definition site is better than bloat at use site</p>
<p>&nbsp;</p>
<p>or -</p>
<p>&nbsp;</p>
<p>invariant class Person ... // as above</p>
<p>&nbsp;</p>
<p>or -</p>
<p>&nbsp;</p>
<p>immutable class Person! ... // as above</p>
<p>&nbsp;</p>
<p>Strip away some paths of expression (implicit nullability, implicit mutability, implicit side-effects) and you give the compiler greater (or at least easier access to) freedom to do radical program transformation. I'd like to think that's where we're going...</p>
<p>&nbsp;</p>
<p>One thing is reversing the present. Another is reversing the (sins of the) past - also known as the .Net Framework... But that reversal probably begins with a more principled C#.</p>
</div></blockquote>
<p>Is there any actual compilers against functional language that can do analytical optimizations?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e6350a912179407c9d3b9deb0009847e#e6350a912179407c9d3b9deb0009847e</link>
		<pubDate>Fri, 30 Oct 2009 06:18:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e6350a912179407c9d3b9deb0009847e#e6350a912179407c9d3b9deb0009847e</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Bass said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Is there any actual compilers against functional language that can do analytical optimizations?</p>
</div></blockquote>
<p>Not quite sure what you mean but this work impresses me</p>
<p>&nbsp;</p>
<p><a href="http://www.cse.unsw.edu.au/~dons/papers/CLS07.html">http://www.cse.unsw.edu.au/~dons/papers/CLS07.html</a>&nbsp;</p>
<p><a href="http://www.cse.unsw.edu.au/~dons/papers/CLS07.html"></a></p>
<blockquote><em>This paper presents an automatic fusion system, stream fusion, based on equational transformations, that fuses a wider range of functions than existing short-cut fusion systems. In particular, stream fusion is able to fuse zips, left folds and
 functions over nested lists, including list comprehensions. A distinguishing feature of the stream fusion framework is its simplicity: by transforming list functions to expose their structure, intermediate values are eliminated by general purpose compiler
 optimisations. </em></blockquote>
<blockquote><em>We have reimplemented the entire Haskell standard list library on top of our framework, providing stream fusion for Haskell lists. By allowing a wider range of functions to fuse, we see an increase in the number of occurrences of fusion in typical
 Haskell programs. We present benchmarks documenting time and space improvements.</em></blockquote></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c65e87949f1548a284ce9deb000984a8#c65e87949f1548a284ce9deb000984a8</link>
		<pubDate>Fri, 30 Oct 2009 18:33:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c65e87949f1548a284ce9deb000984a8#c65e87949f1548a284ce9deb000984a8</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Bass said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Not quite sure what you mean but this work impresses me</p>
<p>&nbsp;</p>
<p><a href="http://www.cse.unsw.edu.au/~dons/papers/CLS07.html">http://www.cse.unsw.edu.au/~dons/papers/CLS07.html</a>&nbsp;</p>
<p><a href="http://www.cse.unsw.edu.au/~dons/papers/CLS07.html"></a></p>
<blockquote><em>This paper presents an automatic fusion system, stream fusion, based on equational transformations, that fuses a wider range of functions than existing short-cut fusion systems. In particular, stream fusion is able to fuse zips, left folds and
 functions over nested lists, including list comprehensions. A distinguishing feature of the stream fusion framework is its simplicity: by transforming list functions to expose their structure, intermediate values are eliminated by general purpose compiler
 optimisations. </em></blockquote>
<blockquote><em>We have reimplemented the entire Haskell standard list library on top of our framework, providing stream fusion for Haskell lists. By allowing a wider range of functions to fuse, we see an increase in the number of occurrences of fusion in typical
 Haskell programs. We present benchmarks documenting time and space improvements.</em></blockquote>
</div></blockquote>
<p>I'd like to propose an === operator, or &quot;is identical to&quot; operator, unlike == it isn't overridable (so it's good for ensuring reference equality when working with types that override == without manually calling Object.ReferenceEquals). It'd also work on
 structs where == is a value comparison and not a reference comparion by default.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/853663783c1b4ff3889e9deb000984d3#853663783c1b4ff3889e9deb000984d3</link>
		<pubDate>Sat, 31 Oct 2009 01:39:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/853663783c1b4ff3889e9deb000984d3#853663783c1b4ff3889e9deb000984d3</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>I would like to see features to make it easier to create data types with value semantics. This includes both classes (reference types) and structs. Currently there is a lot of unnecessary work between Equals, IEquatable, IClonable, GetHashCode, operator==,
 etc, with most of the work simple stuff that could be automated. For example, by default, you probably want equality and assignment to be defined as equality and assignment of fields, so there should be a way to get that automatically, and&nbsp;declaratively&nbsp;handle
 exceptions via attributes.</p>
<p>&nbsp;</p>
<p>Switching from a class to a struct, or vice versa, is painful, for no reason.</p>
<p>&nbsp;</p>
<p>I should not have to choose between class or struct in order to be able to choose between heap or stack allocation. Heap or stack allocation should be a decision of the user of a data type, not the implementation of the data type. That is a more extreme
 and probably not possible without breaking c#, because we need syntax to indicate what is a reference, and what is a value, as in C&#43;&#43;.</p>
<p>&nbsp;</p>
<p>We need the notion of const-ness and const-correctness that can carry through, so we know what is immutable at a deep level. Basically, we need a more mathematically oriented language.</p>
<p>&nbsp;</p>
<p>I would like to see a JIT compiler that can perform as well as Java's hot-spot compiler on high performance computing applications.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/63912f54064747dba1eb9deb00098501#63912f54064747dba1eb9deb00098501</link>
		<pubDate>Sat, 31 Oct 2009 03:05:27 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/63912f54064747dba1eb9deb00098501#63912f54064747dba1eb9deb00098501</guid>
		<dc:creator>Frank Hileman</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Frank Hileman/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Bass said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Not quite sure what you mean but this work impresses me</p>
<p>&nbsp;</p>
<p><a href="http://www.cse.unsw.edu.au/~dons/papers/CLS07.html">http://www.cse.unsw.edu.au/~dons/papers/CLS07.html</a>&nbsp;</p>
<p><a href="http://www.cse.unsw.edu.au/~dons/papers/CLS07.html"></a></p>
<blockquote><em>This paper presents an automatic fusion system, stream fusion, based on equational transformations, that fuses a wider range of functions than existing short-cut fusion systems. In particular, stream fusion is able to fuse zips, left folds and
 functions over nested lists, including list comprehensions. A distinguishing feature of the stream fusion framework is its simplicity: by transforming list functions to expose their structure, intermediate values are eliminated by general purpose compiler
 optimisations. </em></blockquote>
<blockquote><em>We have reimplemented the entire Haskell standard list library on top of our framework, providing stream fusion for Haskell lists. By allowing a wider range of functions to fuse, we see an increase in the number of occurrences of fusion in typical
 Haskell programs. We present benchmarks documenting time and space improvements.</em></blockquote>
</div></blockquote>
<p>Vala is a language inspired by C# which does not allow null reference types without explictly idenitfying them as nullable.</p>
<p>&nbsp;</p>
<p>eg:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">string foo()
{
   return null;
}

   </pre>
<p></p>
<p>&nbsp;</p>
<p>won't compile</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">string? foo()
{
   return null;
}

   </pre>
<p></p>
<p>&nbsp;</p>
<p>would.</p>
<p>&nbsp;</p>
<p>This will alert the caller on the possibility that function can return null, and thus the programmer can take the needed precautions.</p>
<p>&nbsp;</p>
<p>C# could use similar syntax. Hopefully one day we can get rid of NullReferenceExceptions for good. They do not belong in an managed language IMO.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/34c968332c7946cba3fb9deb0009852f#34c968332c7946cba3fb9deb0009852f</link>
		<pubDate>Sat, 31 Oct 2009 03:19:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/34c968332c7946cba3fb9deb0009852f#34c968332c7946cba3fb9deb0009852f</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Frank Hileman said:</div><div class="quoteText">
<p>I would like to see features to make it easier to create data types with value semantics. This includes both classes (reference types) and structs. Currently there is a lot of unnecessary work between Equals, IEquatable, IClonable, GetHashCode, operator==,
 etc, with most of the work simple stuff that could be automated. For example, by default, you probably want equality and assignment to be defined as equality and assignment of fields, so there should be a way to get that automatically, and&nbsp;declaratively&nbsp;handle
 exceptions via attributes.</p>
<p>&nbsp;</p>
<p>Switching from a class to a struct, or vice versa, is painful, for no reason.</p>
<p>&nbsp;</p>
<p>I should not have to choose between class or struct in order to be able to choose between heap or stack allocation. Heap or stack allocation should be a decision of the user of a data type, not the implementation of the data type. That is a more extreme
 and probably not possible without breaking c#, because we need syntax to indicate what is a reference, and what is a value, as in C&#43;&#43;.</p>
<p>&nbsp;</p>
<p>We need the notion of const-ness and const-correctness that can carry through, so we know what is immutable at a deep level. Basically, we need a more mathematically oriented language.</p>
<p>&nbsp;</p>
<p>I would like to see a JIT compiler that can perform as well as Java's hot-spot compiler on high performance computing applications.</p>
</div></blockquote>
<p>Actually the language D has very sophisticated (transitive) const semantics.</p>
<p>&nbsp;</p>
<p>In many cases I think defining const-ness or immutability is a definition-site problem. If a type is inherently mutable, I'm not so sure it makes sense to force a new immutable version of it. Types should be designed to work as immutable or mutable and the
 type-system should maybe help you track if you let an impure object flow through a method call (e.g. by forcing you to mark the return type as Impure&lt;T&gt;.</p>
<p>&nbsp;</p>
<p>For example, if you let in an impure object in an otherwise pure method and you then compute some result based on it - but accessing properties of the object changes the object itself (let's just say it's an evil object), then this means that the method
 is still pure in a way but if you then call the same method again with the same object, it will break - because technically it's not the same object anymore. So the method is no longer reflexively pure.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/76d74e0e78cb4f63989a9deb0009855d#76d74e0e78cb4f63989a9deb0009855d</link>
		<pubDate>Sat, 31 Oct 2009 06:14:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/76d74e0e78cb4f63989a9deb0009855d#76d74e0e78cb4f63989a9deb0009855d</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>More about tuples. I see in .Net 4.0 beta 2 they are implemented as classes. How about this?</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public struct STuple&lt;a&gt;
{
    private readonly a x;
    public a Item
    {
        get { return x; }
    }
    public STuple(a a)
    {
        x = a;
    }
}
public struct STuple&lt;a, b&gt;
{
    private readonly a x;
    private readonly STuple&lt;b&gt; s;
    public a Item
    {
        get { return x; }
    }
    public STuple&lt;b&gt; Rest
    {
        get { return s; }
    }
    public STuple(a a, b b)
    {
        x = a;
        s = new STuple&lt;b&gt;(b);
    }
}
public struct STuple&lt;a, b, c&gt;
{
    private readonly a x;
    private readonly STuple&lt;b, c&gt; s;
    public a Item
    {
        get { return x; }
    }
    public STuple&lt;b, c&gt; Rest
    {
        get { return s; }
    }
    public STuple(a a, b b, c c)
    {
        x = a;
        s = new STuple&lt;b, c&gt;(b, c);
    }
}
public struct STuple&lt;a, b, c, d&gt;
{
    private readonly a x;
    private readonly STuple&lt;b, c, d&gt; s;
    public a Item
    {
        get { return x; }
    }
    public STuple&lt;b, c, d&gt; Rest
    {
        get { return s; }
    }
    public STuple(a a, b b, c c, d d)
    {
        x = a;
        s = new STuple&lt;b, c, d&gt;(b, c, d);
    }
}
public struct STuple&lt;a, b, c, d, e&gt;
{
    private readonly a x;
    private readonly STuple&lt;b, c, d, e&gt; s;
    public a Item
    {
        get { return x; }
    }
    public STuple&lt;b, c, d, e&gt; Rest
    {
        get { return s; }
    }
    public STuple(a a, b b, c c, d d, e e)
    {
        x = a;
        s = new STuple&lt;b, c, d, e&gt;(b, c, d, e);
    }
}</pre>
<p></p>
<p>&nbsp;</p>
<p>As you can see they are recursively constructed structs. Their definition is much like linked lists, only here defined statically as heterogeneous nested structs.</p>
<p>&nbsp;</p>
<p>It looks quite elegant and I'd expect more efficient for what tuples will often be used for than a class based implementation. There is no interface compatibility because C# forbids it. Also in this form the code is not FxCop compatible (lower-case type
 parameters and sins like that).</p>
<p>&nbsp;</p>
<p>Now how to make these semantics better?&nbsp;It would be cool if the following was possible</p>
<ul>
<li>an (s)tuple of a higher dimension extends an&nbsp;(s)tuple&nbsp;of a lower dimension (structural matching between lower- and higher-dimensional (s)tuples)
</li><li>an (s)tuple is an IEnumerable&lt;dynamic&gt; when heterogeneous </li><li>an (s)tuple is an IEnumerable&lt;T&gt; when homogeneous </li></ul>
<p>These ideas will require an extension of the generic type system for C#. For examples in C# there is no struct inheritance or &nbsp;struct interface inheritance.</p>
<p>&nbsp;</p>
<p>Thoughts?</p>
<p>&nbsp;</p>
<p>[2nd revision]</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/471ab28149564ae38bd59deb00098589#471ab28149564ae38bd59deb00098589</link>
		<pubDate>Sun, 01 Nov 2009 21:27:40 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/471ab28149564ae38bd59deb00098589#471ab28149564ae38bd59deb00098589</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>More about tuples. I see in .Net 4.0 beta 2 they are implemented as classes. How about this?</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public struct STuple&lt;a&gt;
{
    private readonly a x;
    public a Item
    {
        get { return x; }
    }
    public STuple(a a)
    {
        x = a;
    }
}
public struct STuple&lt;a, b&gt;
{
    private readonly a x;
    private readonly STuple&lt;b&gt; s;
    public a Item
    {
        get { return x; }
    }
    public STuple&lt;b&gt; Rest
    {
        get { return s; }
    }
    public STuple(a a, b b)
    {
        x = a;
        s = new STuple&lt;b&gt;(b);
    }
}
public struct STuple&lt;a, b, c&gt;
{
    private readonly a x;
    private readonly STuple&lt;b, c&gt; s;
    public a Item
    {
        get { return x; }
    }
    public STuple&lt;b, c&gt; Rest
    {
        get { return s; }
    }
    public STuple(a a, b b, c c)
    {
        x = a;
        s = new STuple&lt;b, c&gt;(b, c);
    }
}
public struct STuple&lt;a, b, c, d&gt;
{
    private readonly a x;
    private readonly STuple&lt;b, c, d&gt; s;
    public a Item
    {
        get { return x; }
    }
    public STuple&lt;b, c, d&gt; Rest
    {
        get { return s; }
    }
    public STuple(a a, b b, c c, d d)
    {
        x = a;
        s = new STuple&lt;b, c, d&gt;(b, c, d);
    }
}
public struct STuple&lt;a, b, c, d, e&gt;
{
    private readonly a x;
    private readonly STuple&lt;b, c, d, e&gt; s;
    public a Item
    {
        get { return x; }
    }
    public STuple&lt;b, c, d, e&gt; Rest
    {
        get { return s; }
    }
    public STuple(a a, b b, c c, d d, e e)
    {
        x = a;
        s = new STuple&lt;b, c, d, e&gt;(b, c, d, e);
    }
}</pre>
<p></p>
<p>&nbsp;</p>
<p>As you can see they are recursively constructed structs. Their definition is much like linked lists, only here defined statically as heterogeneous nested structs.</p>
<p>&nbsp;</p>
<p>It looks quite elegant and I'd expect more efficient for what tuples will often be used for than a class based implementation. There is no interface compatibility because C# forbids it. Also in this form the code is not FxCop compatible (lower-case type
 parameters and sins like that).</p>
<p>&nbsp;</p>
<p>Now how to make these semantics better?&nbsp;It would be cool if the following was possible</p>
<ul>
<li>an (s)tuple of a higher dimension extends an&nbsp;(s)tuple&nbsp;of a lower dimension (structural matching between lower- and higher-dimensional (s)tuples)
</li><li>an (s)tuple is an IEnumerable&lt;dynamic&gt; when heterogeneous </li><li>an (s)tuple is an IEnumerable&lt;T&gt; when homogeneous </li></ul>
<p>These ideas will require an extension of the generic type system for C#. For examples in C# there is no struct inheritance or &nbsp;struct interface inheritance.</p>
<p>&nbsp;</p>
<p>Thoughts?</p>
<p>&nbsp;</p>
<p>[2nd revision]</p>
</div></blockquote>
<p>how is a.Rest.Rest.Rest.Rest.Item more readable than a.Item4?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e36a090129fc4b80b25f9deb000985b8#e36a090129fc4b80b25f9deb000985b8</link>
		<pubDate>Mon, 02 Nov 2009 09:06:14 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e36a090129fc4b80b25f9deb000985b8#e36a090129fc4b80b25f9deb000985b8</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Ion Todirel said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>how is a.Rest.Rest.Rest.Rest.Item more readable than a.Item4?</p>
</div></blockquote>
<p>That's just a way to structure the definition in a &quot;compositional&quot; way. One should not normally access the items in this way (given syntax support for tuples as mentioned earlier in wkempf). Although if you want to, it'd be easy to create getters that did
 this traversal. You could define properties such as Length and indexers such as Item ([]).</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/cb80ce8eb9d346eaa25b9deb000985df#cb80ce8eb9d346eaa25b9deb000985df</link>
		<pubDate>Mon, 02 Nov 2009 11:05:13 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/cb80ce8eb9d346eaa25b9deb000985df#cb80ce8eb9d346eaa25b9deb000985df</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Ion Todirel said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>how is a.Rest.Rest.Rest.Rest.Item more readable than a.Item4?</p>
</div></blockquote>
<p>To illustrate</p>
<p></p>
<pre class="brush: csharp">public struct STuple&lt;a&gt;
{
    private readonly a x;
    public a Some
    {
        get { return x; }
    }
    public a this[int index]
    {
        get
        {
            if (index != 0)
                throw new IndexOutOfRangeException();
            else
                return x;
        }
    }
    public IEnumerator&lt;a&gt; GetEnumerator()
    {
        yield return Some;
    }
    public static int Index
    {
        get { return 0; }
    }
    public static int Length
    {
        get { return Index &#43; 1; }
    }
    public STuple(a a)
    {
        x = a;
    }
}
public struct STuple&lt;a, b&gt;
{
    private readonly a x;
    private readonly STuple&lt;b&gt; s;
    public a Some
    {
        get { return x; }
    }
    public STuple&lt;b&gt; Rest
    {
        get { return s; }
    }
    public dynamic this[int index]
    {
        get
        {
            if (index &gt; Index || index &lt; 0)
                throw new IndexOutOfRangeException();
            else
                return index == Index
                    ? Some as dynamic
                    : Rest.Some as dynamic;
        }
    }
    public IEnumerator&lt;dynamic&gt; GetEnumerator()
    {
        yield return Some;
        yield return Rest.Some;
    }
    public static int Index
    {
        // C# forbids: (Rest.Index &#43; 1)
        get { return 1; }
    }
    public static int Length
    {
        get { return Index &#43; 1; }
    }
    public STuple(a a, b b)
    {
        x = a;
        s = new STuple&lt;b&gt;(b);
    }
}</pre>
<p></p>
<p>Example</p>
<p></p>
<pre class="brush: csharp">var a = new STuple&lt;int&gt;(3);
var b = new STuple&lt;int,int&gt;(1,2);
foreach (var x in a)
    Console.WriteLine(x);
foreach (object x in b)
    Console.WriteLine(x);
Console.ReadKey();
</pre>
<p></p>
<p>If we could somehow express a version of GetEnumerator that only applies to a homogeneous (s)tuple, meaning (s)tuple where all type parameters are equal, then there would be no need for a dynamic formulation, esp. as this is statically known.</p>
<p></p>
<pre class="brush: csharp">public static class STupleExtensions
{
    public static IEnumerator&lt;a&gt; GetEnumerator&lt;a&gt;(this STuple&lt;a, a&gt; s)
    {
        yield return s.Some;
        yield return s.Rest.Some;
    }
}
</pre>
<p></p>
<p>I realize though that this kind of trickery is probably not very high on any wishlist heh</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/da1758cf28eb45b485749deb0009860c#da1758cf28eb45b485749deb0009860c</link>
		<pubDate>Mon, 02 Nov 2009 19:18:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/da1758cf28eb45b485749deb0009860c#da1758cf28eb45b485749deb0009860c</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Is it even ON the wishlist? can you explain why somebody would want this vs the .net tuple class? regardless of source naming guidelines <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif' alt='Tongue Out' />.. (having type arg a and paramter a is really needlessly complicated).. personally I think you have a over obsession
 with functional style code.</p>
<p>&nbsp;</p>
<p>C# isn't classically functional, so trying to treat it so is really pretty abusive and it shows with how you'd need to use it.. if you want to go nuts on functional style, why not just pick a language that is based on functional foundations like F#?</p>
<p>&nbsp;</p>
<p>Your efforts would be much more rewarding there.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a02e4c5a0d6445b998939deb00098636#a02e4c5a0d6445b998939deb00098636</link>
		<pubDate>Mon, 02 Nov 2009 22:25:00 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a02e4c5a0d6445b998939deb00098636#a02e4c5a0d6445b998939deb00098636</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">stevo_ said:</div><div class="quoteText">
<p>Is it even ON the wishlist? can you explain why somebody would want this vs the .net tuple class? regardless of source naming guidelines
<img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif" alt="Tongue Out">.. (having type arg a and paramter a is really needlessly complicated).. personally I think you have a over obsession with functional style code.</p>
<p>&nbsp;</p>
<p>C# isn't classically functional, so trying to treat it so is really pretty abusive and it shows with how you'd need to use it.. if you want to go nuts on functional style, why not just pick a language that is based on functional foundations like F#?</p>
<p>&nbsp;</p>
<p>Your efforts would be much more rewarding there.</p>
</div></blockquote>
<p>There are several things to consider. (The why is explained previously but see the end of this post as well (the questions)).</p>
<p>&nbsp;</p>
<p>Types are shared across languages, imperative or declarative. The discussion here is about the formulation of tuples in .Net, so it is really language agnostic in a sense, it just so happens that C# is quite close to the lingua franca of .Net, MSIL. It could've
 been VB too for that matter. F# has a succint syntax but I'm not very convinced its fundamentally more functional than C# for example, given that C# now has lambdas and &quot;monadic syntax&quot;. Both F# and C# are hybrid imperative/declarative/object-oriented languages;
 and F# has had to adapt to this as the .Net Framework is object-oriented (one possible interpretation of the dot in dot net?).&nbsp;So I don't believe a resistance to functional style C# is that meaningful in the larger scheme of things.</p>
<p>&nbsp;</p>
<p>The experimental code provided here is just to show how tuples could be defined in a more &quot;compositional&quot; way. There is disagreement as to whether this is a good thing. That's good &nbsp;and certainly does not discourage me from experimenting - I find this both
 educational and fun. C# or F#, it really doesn't make that much difference to me. Types are shared - the fundamental means of expression also.</p>
<p>&nbsp;</p>
<p>So you should refocus your attention to the semantics: are tuples as sequences helpful or harmful; are tuples as structs vs classes helpful or harmful; are a &quot;recursive&quot; definition of tuples more helpful than a flat definition?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c9480155b54a4f62af639deb00098664#c9480155b54a4f62af639deb00098664</link>
		<pubDate>Mon, 02 Nov 2009 23:01:36 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c9480155b54a4f62af639deb00098664#c9480155b54a4f62af639deb00098664</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">stevo_ said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>There are several things to consider. (The why is explained previously but see the end of this post as well (the questions)).</p>
<p>&nbsp;</p>
<p>Types are shared across languages, imperative or declarative. The discussion here is about the formulation of tuples in .Net, so it is really language agnostic in a sense, it just so happens that C# is quite close to the lingua franca of .Net, MSIL. It could've
 been VB too for that matter. F# has a succint syntax but I'm not very convinced its fundamentally more functional than C# for example, given that C# now has lambdas and &quot;monadic syntax&quot;. Both F# and C# are hybrid imperative/declarative/object-oriented languages;
 and F# has had to adapt to this as the .Net Framework is object-oriented (one possible interpretation of the dot in dot net?).&nbsp;So I don't believe a resistance to functional style C# is that meaningful in the larger scheme of things.</p>
<p>&nbsp;</p>
<p>The experimental code provided here is just to show how tuples could be defined in a more &quot;compositional&quot; way. There is disagreement as to whether this is a good thing. That's good &nbsp;and certainly does not discourage me from experimenting - I find this both
 educational and fun. C# or F#, it really doesn't make that much difference to me. Types are shared - the fundamental means of expression also.</p>
<p>&nbsp;</p>
<p>So you should refocus your attention to the semantics: are tuples as sequences helpful or harmful; are tuples as structs vs classes helpful or harmful; are a &quot;recursive&quot; definition of tuples more helpful than a flat definition?</p>
</div></blockquote>
<p>So let me boil it down to its absolute undeniable essence</p>
<p>&nbsp;</p>
<p>STuple pros</p>
<p>- structs; for performance reasons (makes sense for tuples as most tuples are less than 10 elements)</p>
<p>- recursion; for composition (tuple.Rest rather than new Tuple&lt;A,B&gt;(tuple.Item1, tuple.Item2); to be fair: representation bias)</p>
<p>- enumeration; for composition (use tuples directly as sequences which, intuitively they are)</p>
<p>&nbsp;</p>
<p>Tuple pros</p>
<p>- classes; for nominal typing (: INominal&lt;T&gt;)</p>
<p>- flatness; for ease of comprehension and simplicity</p>
<p>- non-enumeration; unmistakeable distinctness, no accidental application of abstraction</p>
<p>&nbsp;</p>
<p>The tension here is somewhat like structural vs nominal typing. Is it a duck if it looks, walks and quacks like a duck or is it only a duck if it has duck painted over it?</p>
<p>&nbsp;</p>
<p>These are choices. Being aware that there are choices being made for you and what the trade-offs are, is useful. I'm sure there are good reasons for the current design - nevertheless it is interesting to examine other paths of expression</p>
<p>&nbsp;</p>
<p><img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/95695c9332dc42ec9a2d9deb00098693#95695c9332dc42ec9a2d9deb00098693</link>
		<pubDate>Mon, 02 Nov 2009 23:53:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/95695c9332dc42ec9a2d9deb00098693#95695c9332dc42ec9a2d9deb00098693</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>So let me boil it down to its absolute undeniable essence</p>
<p>&nbsp;</p>
<p>STuple pros</p>
<p>- structs; for performance reasons (makes sense for tuples as most tuples are less than 10 elements)</p>
<p>- recursion; for composition (tuple.Rest rather than new Tuple&lt;A,B&gt;(tuple.Item1, tuple.Item2); to be fair: representation bias)</p>
<p>- enumeration; for composition (use tuples directly as sequences which, intuitively they are)</p>
<p>&nbsp;</p>
<p>Tuple pros</p>
<p>- classes; for nominal typing (: INominal&lt;T&gt;)</p>
<p>- flatness; for ease of comprehension and simplicity</p>
<p>- non-enumeration; unmistakeable distinctness, no accidental application of abstraction</p>
<p>&nbsp;</p>
<p>The tension here is somewhat like structural vs nominal typing. Is it a duck if it looks, walks and quacks like a duck or is it only a duck if it has duck painted over it?</p>
<p>&nbsp;</p>
<p>These are choices. Being aware that there are choices being made for you and what the trade-offs are, is useful. I'm sure there are good reasons for the current design - nevertheless it is interesting to examine other paths of expression</p>
<p>&nbsp;</p>
<p><img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif" alt="Smiley"></p>
</div></blockquote>
<p><em>&gt;&nbsp;recursion; for composition (tuple.Rest rather than new Tuple&lt;A,B&gt;(tuple.Item1, tuple.Item2); to be fair: representation bias)</em></p>
<p>I would call .Rest.Rest.Rest.* a bad design rather than a different representation, get a&nbsp;better&nbsp;name and I may change my mind <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif' alt='Tongue Out' /></p>
<p>&nbsp;</p>
<p><em>&gt; enumeration; for composition (use tuples directly as sequences which, intuitively they are)</em></p>
<p>And how are you going to enumerate them, return a IEnumerable&lt;object&gt;?&nbsp;That&nbsp;surely ain't cool.</p>
<p>&nbsp;</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7be4b6aafbb2453080cf9deb000986bf#7be4b6aafbb2453080cf9deb000986bf</link>
		<pubDate>Thu, 05 Nov 2009 05:11:26 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7be4b6aafbb2453080cf9deb000986bf#7be4b6aafbb2453080cf9deb000986bf</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Ion Todirel said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p><em>&gt;&nbsp;recursion; for composition (tuple.Rest rather than new Tuple&lt;A,B&gt;(tuple.Item1, tuple.Item2); to be fair: representation bias)</em></p>
<p>I would call .Rest.Rest.Rest.* a bad design rather than a different representation, get a&nbsp;better&nbsp;name and I may change my mind
<img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif" alt="Tongue Out"></p>
<p>&nbsp;</p>
<p><em>&gt; enumeration; for composition (use tuples directly as sequences which, intuitively they are)</em></p>
<p>And how are you going to enumerate them, return a IEnumerable&lt;object&gt;?&nbsp;That&nbsp;surely ain't cool.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div></blockquote>
<p>(1)&nbsp;<strong><em>homogeneous</em></strong><em> tuples</em>: Tommy already showed how you can enumerate them using extension methods. These are fully typed so no problem there. The next step is to define GetEnumerator as part of tuple itself and define it
 only for homogenous tuples -<strong>or</strong>- : given&nbsp;a foreach which would accept type-parametric extension methods, you could just define it as GetEnumerator&lt;T, ...&gt; extension methods.</p>
<blockquote><em>static where possible</em>
<blockquote><em>- nominal too!</em></blockquote>
</blockquote>
<p>(2)&nbsp;<strong><em>heterogeneous </em></strong><em>tuples</em>; as mentioned previously, you can simply use
<strong>dynamic</strong>. In this case you want to be extremely careful of course but you will not have to insert casts; in fact you may want this to be defined as extension methods from a nested namespace (System.Dynamic[.Tuple] or System.Tuple.Dynamic) so
 it isn't automatically imported; or even be able to except some extension methods for a particular variable... well ok, that's extreme</p>
<blockquote><em>dynamic when necessary</em>
<blockquote><em>- structural too!</em></blockquote>
</blockquote>
<p>The name Rest is not so important, although I like it (and it rhymes with Best - beat that!). Of course Rest could also be defined for tuples as they are defined today (Tuple&lt;T, ...&gt;), it just so happens it isn't. I wouldn't call a design bad because of
 a name but of course names are important in the final design; I've not picked the names with respect to a broader audience; such &quot;streamlining&quot; is not really interesting in the initial design phase, more of a distraction.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/8e210953316b418ea7f39deb000986ed#8e210953316b418ea7f39deb000986ed</link>
		<pubDate>Thu, 05 Nov 2009 07:00:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/8e210953316b418ea7f39deb000986ed#8e210953316b418ea7f39deb000986ed</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Vriff Polo said:</div><div class="quoteText">
<p>First class dependency objects and properties;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public dependency class Person
{
	public dependency string Name 
	{ 
		get;
		set; 
		default { return &quot;John Doe&quot;; }
		change { Console.WriteLine(&quot;Old: {0}, New: {1}&quot;, oldvalue, newvalue); }
	}
}</pre>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>instead of</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public class Person: DependencyObject
{
	public static readonly DependencyProperty NameProperty = DependencyProperty.Register(
		&quot;Name&quot;, typeof(string), typeof(Person), new PropertyMetadata(&quot;John Doe&quot;, OnNameChanged));
	
	private static void OnNameChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
	{
		((Person)sender).OnNameChanged((string)args.OldValue, (string)args.NewValue);
	}
 
	public string Name
	{
		get { return (string)GetValue(NameProperty); }
		set { SetValue(NameProperty, value); }
	}
	private void OnNameChanged(string oldvalue, string newvalue)
	{
		Console.WriteLine(&quot;Old: {0}, New {1}&quot;, oldvalue, newvalue);
	}
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Would be nice if something like this could also work with INotifyPropertyChanged, IDataErrorInfo and IEditableObject.</p>
<p>&nbsp;</p>
</div></blockquote>
<p>I like tuple syntax, but I kinda feel it fails the -100 point test for C#. &nbsp;re enumeration of tuple values, this seems more of a metaprogramming kind of feature and actually can't you do it with reflection even now? &nbsp;actually, isn't this more or less equivalent
 to serialization?</p>
<p>&nbsp;</p>
<p>&nbsp;I would definitely like to see some kind of language feature that makes declarative dataflow and data binding less awkward. &nbsp;It doesn't
<em>have </em>to be direct support for the WPF dependency property system -- although I'd personally welcome that -- but maybe there's some more general feature that would still allow something like WPF dependency properties to be built on top of it and be
 syntactically nicer, though I can't think just what that would be at the moment.</p>
<p>&nbsp;</p>
<p>I would of course also welcome better support for non-nullable and immutable values -- and pure functions -- but I suspect this may have to wait for a successor language to C# (which might still be called C# as with VB6 -&gt; VB.NET).</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/fcb21a128ac943fb87919deb00098719#fcb21a128ac943fb87919deb00098719</link>
		<pubDate>Mon, 09 Nov 2009 03:26:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/fcb21a128ac943fb87919deb00098719#fcb21a128ac943fb87919deb00098719</guid>
		<dc:creator>contextfree</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/contextfree/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">contextfree said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Vriff Polo said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I like tuple syntax, but I kinda feel it fails the -100 point test for C#. &nbsp;re enumeration of tuple values, this seems more of a metaprogramming kind of feature and actually can't you do it with reflection even now? &nbsp;actually, isn't this more or less equivalent
 to serialization?</p>
<p>&nbsp;</p>
<p>&nbsp;I would definitely like to see some kind of language feature that makes declarative dataflow and data binding less awkward. &nbsp;It doesn't
<em>have </em>to be direct support for the WPF dependency property system -- although I'd personally welcome that -- but maybe there's some more general feature that would still allow something like WPF dependency properties to be built on top of it and be
 syntactically nicer, though I can't think just what that would be at the moment.</p>
<p>&nbsp;</p>
<p>I would of course also welcome better support for non-nullable and immutable values -- and pure functions -- but I suspect this may have to wait for a successor language to C# (which might still be called C# as with VB6 -&gt; VB.NET).</p>
</div></blockquote>
<p>Two questions for you contextfree <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></p>
<p>- what is the -100 point test for C# (and how does it relate to any tuple syntax)</p>
<p>- how is enumeration of tuples equivalent to serialization</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/d700ef3248674507b6109deb00098744#d700ef3248674507b6109deb00098744</link>
		<pubDate>Mon, 09 Nov 2009 08:29:24 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/d700ef3248674507b6109deb00098744#d700ef3248674507b6109deb00098744</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Frank Hileman said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Actually the language D has very sophisticated (transitive) const semantics.</p>
<p>&nbsp;</p>
<p>In many cases I think defining const-ness or immutability is a definition-site problem. If a type is inherently mutable, I'm not so sure it makes sense to force a new immutable version of it. Types should be designed to work as immutable or mutable and the
 type-system should maybe help you track if you let an impure object flow through a method call (e.g. by forcing you to mark the return type as Impure&lt;T&gt;.</p>
<p>&nbsp;</p>
<p>For example, if you let in an impure object in an otherwise pure method and you then compute some result based on it - but accessing properties of the object changes the object itself (let's just say it's an evil object), then this means that the method
 is still pure in a way but if you then call the same method again with the same object, it will break - because technically it's not the same object anymore. So the method is no longer reflexively pure.</p>
</div></blockquote>
<p>I agree with you. I would like to be able to specify the semantics of a data type or method more easily: should it be treated as immutable, or not (const). Should an argument be considered deeply const, etc. The compiler can take advantage of that and we
 can be free to break the rules, to add diagnostic fields to data types, for example.</p>
<p>&nbsp;</p>
<p>The main problem I have is the clumsiness of value semantics in c#. This is just language weirdness.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/83e07d48882e4295a8de9deb00098770#83e07d48882e4295a8de9deb00098770</link>
		<pubDate>Sat, 14 Nov 2009 08:44:30 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/83e07d48882e4295a8de9deb00098770#83e07d48882e4295a8de9deb00098770</guid>
		<dc:creator>Frank Hileman</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Frank Hileman/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Frank Hileman said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I agree with you. I would like to be able to specify the semantics of a data type or method more easily: should it be treated as immutable, or not (const). Should an argument be considered deeply const, etc. The compiler can take advantage of that and we
 can be free to break the rules, to add diagnostic fields to data types, for example.</p>
<p>&nbsp;</p>
<p>The main problem I have is the clumsiness of value semantics in c#. This is just language weirdness.</p>
</div></blockquote>
<p>There is some elegance as well: auto-boxing and unboxing of values. &lt;edit:wrong&gt;On the other hand it is strange[1] that it's not possible to express that a struct (such as Tuple) conforms to an interface (such as IComparable&lt;T&gt;). Being a struct offsets you
 to a second-class[2] citizenship, stripped of priviledges such as interface inheritance.&lt;/edit:wrong&gt;</p>
<p>&nbsp;</p>
<p>Constness is really about purity as immutable objects lead to purity. Structs render mutability a tiny bit better as you always pass around copies but if a struct is mutable then it's still&nbsp;fundamentally impure and assists in permeating impurity; at least
 in an impure setting; say you have a method that has a local variable that is a struct type, then mutating this should be no major issue but if, on the other hand, this struct is not local but ambient in the object, then mutating it will affect purity of the
 object.</p>
<p>&nbsp;</p>
<p>I believe D is working towards supporting notions of purity and the same with C# or maybe generally .Net in that I saw some special contract attributes for this somewhere (maybe).</p>
<p>&nbsp;</p>
<p>It's interesting to think about having types be pure but also having a special purity constraint on types which the type-checker can enforce. This is the inverse of what Haskell does: everything is pure unless it's not - and then you get trapped in the IO
 monad. It would be quite nice to have a similar formalism, if reversed, for .Net, where you could express Pure&lt;T&gt;.</p>
<p>&nbsp;</p>
<p>This would of course be a very special type, requiring compiler magic, depending on the power of the language itself; e.g. C# with a step in a multi-step compilation process for doing expression tree verification of static invariants such as purity; well,
 that's an advanced topic: allowing the programmer to extend the type-system/checker with arbitrary invariants; in a way we can think of contracts in this way too (it's just that many invariants can't be statically verified; but using types with more associated
 meaning would seem more powerful; somewhat like dependent typing perhaps.)</p>
<p>&nbsp;</p>
<p>[1] <em>Not strange in a pragmatic sense (language evolution takes time) but weird in an idiological sense (absent a notion of time, one could argue about imperfections such as unnecessary non-uniformity between structs and classes; on the other hand</em>[3]<em>)</em></p>
<p>[2] <em>Not a pun</em></p>
<p>[3]<em>Talk is cheap</em></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9b9b89f6117d4bb7b7429deb000987a0#9b9b89f6117d4bb7b7429deb000987a0</link>
		<pubDate>Sat, 14 Nov 2009 09:05:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9b9b89f6117d4bb7b7429deb000987a0#9b9b89f6117d4bb7b7429deb000987a0</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Frank Hileman said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>There is some elegance as well: auto-boxing and unboxing of values. &lt;edit:wrong&gt;On the other hand it is strange[1] that it's not possible to express that a struct (such as Tuple) conforms to an interface (such as IComparable&lt;T&gt;). Being a struct offsets you
 to a second-class[2] citizenship, stripped of priviledges such as interface inheritance.&lt;/edit:wrong&gt;</p>
<p>&nbsp;</p>
<p>Constness is really about purity as immutable objects lead to purity. Structs render mutability a tiny bit better as you always pass around copies but if a struct is mutable then it's still&nbsp;fundamentally impure and assists in permeating impurity; at least
 in an impure setting; say you have a method that has a local variable that is a struct type, then mutating this should be no major issue but if, on the other hand, this struct is not local but ambient in the object, then mutating it will affect purity of the
 object.</p>
<p>&nbsp;</p>
<p>I believe D is working towards supporting notions of purity and the same with C# or maybe generally .Net in that I saw some special contract attributes for this somewhere (maybe).</p>
<p>&nbsp;</p>
<p>It's interesting to think about having types be pure but also having a special purity constraint on types which the type-checker can enforce. This is the inverse of what Haskell does: everything is pure unless it's not - and then you get trapped in the IO
 monad. It would be quite nice to have a similar formalism, if reversed, for .Net, where you could express Pure&lt;T&gt;.</p>
<p>&nbsp;</p>
<p>This would of course be a very special type, requiring compiler magic, depending on the power of the language itself; e.g. C# with a step in a multi-step compilation process for doing expression tree verification of static invariants such as purity; well,
 that's an advanced topic: allowing the programmer to extend the type-system/checker with arbitrary invariants; in a way we can think of contracts in this way too (it's just that many invariants can't be statically verified; but using types with more associated
 meaning would seem more powerful; somewhat like dependent typing perhaps.)</p>
<p>&nbsp;</p>
<p>[1] <em>Not strange in a pragmatic sense (language evolution takes time) but weird in an idiological sense (absent a notion of time, one could argue about imperfections such as unnecessary non-uniformity between structs and classes; on the other hand</em>[3]<em>)</em></p>
<p>[2] <em>Not a pun</em></p>
<p>[3]<em>Talk is cheap</em></p>
</div></blockquote>
<p><blockquote><div class="quoteText">On the other hand it is strange[1] that it's not possible to express that a struct (such as Tuple) conforms to an interface (such as IComparable&lt;T&gt;).</div></blockquote></p>
<p>That's not true. Structs can implement interfaces just fine.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/07fb23fcff34406e9c629deb000987cf#07fb23fcff34406e9c629deb000987cf</link>
		<pubDate>Sat, 14 Nov 2009 10:16:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/07fb23fcff34406e9c629deb000987cf#07fb23fcff34406e9c629deb000987cf</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Sven Groot said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p></p>
<p>That's not true. Structs can implement interfaces just fine.</p>
</div></blockquote>
<p>Thanks! I tried this a couple of weeks ago but misread the compiler output.</p>
<p>I would kick my own behind for this mistake but anatomy forbids it.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/d98b9adc890b4f0588769deb000987f6#d98b9adc890b4f0588769deb000987f6</link>
		<pubDate>Sat, 14 Nov 2009 10:36:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/d98b9adc890b4f0588769deb000987f6#d98b9adc890b4f0588769deb000987f6</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Ion Todirel said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>To illustrate</p>
<p></p>
<pre class="brush: csharp">public struct STuple&lt;a&gt;
{
    private readonly a x;
    public a Some
    {
        get { return x; }
    }
    public a this[int index]
    {
        get
        {
            if (index != 0)
                throw new IndexOutOfRangeException();
            else
                return x;
        }
    }
    public IEnumerator&lt;a&gt; GetEnumerator()
    {
        yield return Some;
    }
    public static int Index
    {
        get { return 0; }
    }
    public static int Length
    {
        get { return Index &#43; 1; }
    }
    public STuple(a a)
    {
        x = a;
    }
}
public struct STuple&lt;a, b&gt;
{
    private readonly a x;
    private readonly STuple&lt;b&gt; s;
    public a Some
    {
        get { return x; }
    }
    public STuple&lt;b&gt; Rest
    {
        get { return s; }
    }
    public dynamic this[int index]
    {
        get
        {
            if (index &gt; Index || index &lt; 0)
                throw new IndexOutOfRangeException();
            else
                return index == Index
                    ? Some as dynamic
                    : Rest.Some as dynamic;
        }
    }
    public IEnumerator&lt;dynamic&gt; GetEnumerator()
    {
        yield return Some;
        yield return Rest.Some;
    }
    public static int Index
    {
        // C# forbids: (Rest.Index &#43; 1)
        get { return 1; }
    }
    public static int Length
    {
        get { return Index &#43; 1; }
    }
    public STuple(a a, b b)
    {
        x = a;
        s = new STuple&lt;b&gt;(b);
    }
}</pre>
<p></p>
<p>Example</p>
<p></p>
<pre class="brush: csharp">var a = new STuple&lt;int&gt;(3);
var b = new STuple&lt;int,int&gt;(1,2);
foreach (var x in a)
    Console.WriteLine(x);
foreach (object x in b)
    Console.WriteLine(x);
Console.ReadKey();
</pre>
<p></p>
<p>If we could somehow express a version of GetEnumerator that only applies to a homogeneous (s)tuple, meaning (s)tuple where all type parameters are equal, then there would be no need for a dynamic formulation, esp. as this is statically known.</p>
<p></p>
<pre class="brush: csharp">public static class STupleExtensions
{
    public static IEnumerator&lt;a&gt; GetEnumerator&lt;a&gt;(this STuple&lt;a, a&gt; s)
    {
        yield return s.Some;
        yield return s.Rest.Some;
    }
}
</pre>
<p></p>
<p>I realize though that this kind of trickery is probably not very high on any wishlist heh</p>
</div></blockquote>
<p>I'd want that, too. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/0d3692d00b5b491cbf2b9deb00098821#0d3692d00b5b491cbf2b9deb00098821</link>
		<pubDate>Sun, 15 Nov 2009 00:14:04 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/0d3692d00b5b491cbf2b9deb00098821#0d3692d00b5b491cbf2b9deb00098821</guid>
		<dc:creator>Dorian Muthig</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dodo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Dodo said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I'd want that, too. <img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif" alt="Smiley"></p>
</div></blockquote>
<p>Inspired by the XHTML thread, this idea popped up; not new by any means but very much missing in action. First importing the members of a static class (Java people know this as
<em>static import</em>; SML people as <em>open</em>; VB.NET people as something else)</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public double Ex(double x)
{
    using Math;
    var z = 1/Sinh(x);
    ...
    return z3;
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Next: importing the members of an enum</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public enum HtmlChar : ushort
{
    nbsp = '\u00A0'
    ...
}
...
public void Output()
{
    using HtmlChar;
    var e = new XElement(&quot;p&quot;, ..., nbsp, ...);
    ...
    e.Save(...);
}</pre>
<p></p>
<p>&nbsp;</p>
<p>So two very different and very common scenarios covered by this (double-) feature.</p>
<p>&nbsp;</p>
<p>[edit:] ushort does not work for Unicode in general, so have to switch to strings, which rules out enums</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1e93a7e8d92a474d8c169deb0009884d#1e93a7e8d92a474d8c169deb0009884d</link>
		<pubDate>Sun, 15 Nov 2009 12:50:20 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1e93a7e8d92a474d8c169deb0009884d#1e93a7e8d92a474d8c169deb0009884d</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Frank Hileman said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>There is some elegance as well: auto-boxing and unboxing of values. &lt;edit:wrong&gt;On the other hand it is strange[1] that it's not possible to express that a struct (such as Tuple) conforms to an interface (such as IComparable&lt;T&gt;). Being a struct offsets you
 to a second-class[2] citizenship, stripped of priviledges such as interface inheritance.&lt;/edit:wrong&gt;</p>
<p>&nbsp;</p>
<p>Constness is really about purity as immutable objects lead to purity. Structs render mutability a tiny bit better as you always pass around copies but if a struct is mutable then it's still&nbsp;fundamentally impure and assists in permeating impurity; at least
 in an impure setting; say you have a method that has a local variable that is a struct type, then mutating this should be no major issue but if, on the other hand, this struct is not local but ambient in the object, then mutating it will affect purity of the
 object.</p>
<p>&nbsp;</p>
<p>I believe D is working towards supporting notions of purity and the same with C# or maybe generally .Net in that I saw some special contract attributes for this somewhere (maybe).</p>
<p>&nbsp;</p>
<p>It's interesting to think about having types be pure but also having a special purity constraint on types which the type-checker can enforce. This is the inverse of what Haskell does: everything is pure unless it's not - and then you get trapped in the IO
 monad. It would be quite nice to have a similar formalism, if reversed, for .Net, where you could express Pure&lt;T&gt;.</p>
<p>&nbsp;</p>
<p>This would of course be a very special type, requiring compiler magic, depending on the power of the language itself; e.g. C# with a step in a multi-step compilation process for doing expression tree verification of static invariants such as purity; well,
 that's an advanced topic: allowing the programmer to extend the type-system/checker with arbitrary invariants; in a way we can think of contracts in this way too (it's just that many invariants can't be statically verified; but using types with more associated
 meaning would seem more powerful; somewhat like dependent typing perhaps.)</p>
<p>&nbsp;</p>
<p>[1] <em>Not strange in a pragmatic sense (language evolution takes time) but weird in an idiological sense (absent a notion of time, one could argue about imperfections such as unnecessary non-uniformity between structs and classes; on the other hand</em>[3]<em>)</em></p>
<p>[2] <em>Not a pun</em></p>
<p>[3]<em>Talk is cheap</em></p>
</div></blockquote>
<p>Constness (knowing if an object can be modified by a method) might be about purity if you are thinking about functional&nbsp;languages&nbsp;and concurrency. I simply find value semantics easier to reason with and work with, whether or not I am using a functional language
 or concurrency. It feels natural. </p>
<p>&nbsp;</p>
<p>If you make a heap allocated data type (class in C#) immutable, it starts to acquire value semantics. But you still need to implement a lot of boilerplate code (Equals, IEquatable, operator == !=, GetHashcode etc), this code is a waste of time, and it is
 different from the boilerplate code you need for a stack allocated data type (struct in C#). The choice of value semantics or reference semantics should be independent of the allocation technique.&nbsp;</p>
<p>&nbsp;</p>
<p>Ideally, we can change from heap to stack based allocation without changing the data type implementation or usage. C# is probably&nbsp;permanently&nbsp;broken. But anything to move in that direction, and reduce the amount of code bloat, would be helpful.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/8f9e3bafdc874e45b9f59deb0009887f#8f9e3bafdc874e45b9f59deb0009887f</link>
		<pubDate>Tue, 17 Nov 2009 07:51:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/8f9e3bafdc874e45b9f59deb0009887f#8f9e3bafdc874e45b9f59deb0009887f</guid>
		<dc:creator>Frank Hileman</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Frank Hileman/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>I think the biggest and most important change in newer versions of the framework is simply this:</p>
<p>&nbsp;</p>
<p>Companies should upgrade to it.</p>
<p>&nbsp;</p>
<p>My .NET 3 - 4 skills are going to waste, except on my hobby projects. My previous job is just now starting to upgrade to .NET 2.0.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1de8fcf955d6478e82409deb000988a5#1de8fcf955d6478e82409deb000988a5</link>
		<pubDate>Tue, 17 Nov 2009 22:04:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1de8fcf955d6478e82409deb000988a5#1de8fcf955d6478e82409deb000988a5</guid>
		<dc:creator>tsilb</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SlackmasterK/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Not really sure about these but...</p>
<p>(1) Clojure like pure/persistent data structures and STM.</p>
<p>(2) Go like type equivalence.</p>
<p>(3) Erlang like lightweight processes, perhaps using heap allocated stack frames (c.f. Second Life marshalling).</p>
<p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c6556ea7e9e649ac86ad9deb000988e8#c6556ea7e9e649ac86ad9deb000988e8</link>
		<pubDate>Wed, 18 Nov 2009 00:35:41 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c6556ea7e9e649ac86ad9deb000988e8#c6556ea7e9e649ac86ad9deb000988e8</guid>
		<dc:creator>Grant Boyle</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/GrantB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">GrantB said:</div><div class="quoteText">
<p>Not really sure about these but...</p>
<p>(1) Clojure like pure/persistent data structures and STM.</p>
<p>(2) Go like type equivalence.</p>
<p>(3) Erlang like lightweight processes, perhaps using heap allocated stack frames (c.f. Second Life marshalling).</p>
<p>&nbsp;</p>
</div></blockquote>
<p>There doesn't appear to be anything special about Go's notion of type equivalence beyond structural typing. C# has dynamic now, not sure the good folks want to go beyond that because dynamic allows you to apply the same programming pattern but in a less
 type-safe way. Another idea is to be able to coerce a type that structurally matches a different type into that type - a sort of structural cast.</p>
<p>&nbsp;</p>
<p>Love the idea behind persistent data structures.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/0a7480b7c9b7401d9be49deb00098911#0a7480b7c9b7401d9be49deb00098911</link>
		<pubDate>Wed, 18 Nov 2009 00:41:40 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/0a7480b7c9b7401d9be49deb00098911#0a7480b7c9b7401d9be49deb00098911</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>Unnullability a la</p>
<p></p>
<pre class="brush: csharp">    public struct Unnullable&lt;T&gt; where T : class
    {
        public Unnullable(T x)
        {
            if (x == null)
                throw new NullReferenceException();
            item = x;
        }
        public T Item
        {
            get
            {
                return item;
            }
        }
        private readonly T item;
    }
</pre>
<p></p>
<p>and used as such</p>
<p></p>
<pre class="brush: csharp">    class Foo
    {
        int Bar = 3;
    }
    class Program
    {
        static void Main(string[] args)
        {
            var ufoo = new Unnullable&lt;Foo&gt;(new Foo());
            Console.WriteLine(ufoo.Item);
            Unnullable&lt;Foo&gt; baz; // error
            Unnullable&lt;Foo&gt; bax = null; // error
            Unnullable&lt;Foo&gt; box = (Foo)null; // error
            Console.ReadKey();
        }
    }
</pre>
<p></p>
<p>with built-in compiler support so we can simply write</p>
<p></p>
<pre class="brush: csharp">var ufoo = new Foo!(); // type of ufoo is Foo! =&gt; Unnullable&lt;Foo&gt; 
Console.WriteLine(ufoo.bar);</pre>
<p></p>
<p>Even without compiler support it will help catch nullness errors because in this case the compiler just translates ! to Unnullable - a kind of dual of ? which translates to Nullable. And with compiler support you may not even need to explicitly implement
 as Unnullable&lt;T&gt; although it will probably make the implementation easier.</p>
<p>&nbsp;</p>
<p>And of course unnullable classes - where by default the class is unnullable.</p>
</div></blockquote>
<p>mod up Unnullablfe&lt;T&gt; (although I'd prefer NonNullable&lt;T&gt;). It should be usable in all places types are usable today and the framework should make full use of it.&nbsp;This would obviously require a CLR rev. Languages that support it should mark their assemblies
 appropriately, those that don't have the implicit casts/expections added for them by the jit.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c829f484b9fe46df95b79deb00098958#c829f484b9fe46df95b79deb00098958</link>
		<pubDate>Wed, 18 Nov 2009 04:56:54 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c829f484b9fe46df95b79deb00098958#c829f484b9fe46df95b79deb00098958</guid>
		<dc:creator>Spongman</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/piersh/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">piersh said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>mod up Unnullablfe&lt;T&gt; (although I'd prefer NonNullable&lt;T&gt;). It should be usable in all places types are usable today and the framework should make full use of it.&nbsp;This would obviously require a CLR rev. Languages that support it should mark their assemblies
 appropriately, those that don't have the implicit casts/expections added for them by the jit.</p>
</div></blockquote>
<p>Nonnullable&lt;T&gt; is not bad, it's close to the latin Nonnullus which looks and sounds beautiful. That said, personally speaking, there is an strange eerie funny attraction to Unnullable&lt;T&gt;. Anyway, that's naming...</p>
<p>&nbsp;</p>
<p>Actually for non-nullability, we'd probably want two things</p>
<ol>
<li><em>definition-site</em> non-nullability annotation </li><li><em>use-site</em> non-nullability annotation </li></ol>
<p>And preferably we want these to be low-impact in terms of syntax.</p>
<p>&nbsp;</p>
<p>Example 1: <em>use-site</em> non-nullability (ejecting null from the domain of Tuple&lt;int,int&gt;)</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">Tuple&lt;int,int&gt;! thouShaltNull = Tuple.Create(10,20);</pre>
<p></p>
<p>&nbsp;</p>
<p>Example 2: <em>definition-site</em> non-nullability (giving birth to a new type that is non-nullable)</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public class Tuple&lt;int,int&gt;!
{
    ...
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Example 3: <em>use-site</em> nullability of a reference type which is born non-nullable</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">UnnullableTuple&lt;int,int&gt;? thouMayNull = ...;</pre>
<p></p>
<p>&nbsp;</p>
<p>It will be forbidden to construct a combination such as</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">Unnullable&lt;Nullable&lt;Val&gt;&gt; ... // error
Nullable&lt;Unnullable&lt;Ref&gt;&gt; ... // error</pre>
<p></p>
<p>&nbsp;</p>
<p>where Val is some value-type (non-nullable) and Ref is some reference type (nullable); so that the inner type is
<em>born</em> (un-)nullable and at use-site you create a double negation.</p>
<p>&nbsp;</p>
<p>Same as</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">Val?! ... // error
Ref!? ... // error</pre>
<p></p>
<p>&nbsp;</p>
<p>It is also forbidden to create unnnullable&#43;unnullable and nullable&#43;nullable combinations.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/30e7a1861bc242d1a9c59deb00098989#30e7a1861bc242d1a9c59deb00098989</link>
		<pubDate>Wed, 18 Nov 2009 19:23:33 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/30e7a1861bc242d1a9c59deb00098989#30e7a1861bc242d1a9c59deb00098989</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Ion Todirel said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>To illustrate</p>
<p></p>
<pre class="brush: csharp">public struct STuple&lt;a&gt;
{
    private readonly a x;
    public a Some
    {
        get { return x; }
    }
    public a this[int index]
    {
        get
        {
            if (index != 0)
                throw new IndexOutOfRangeException();
            else
                return x;
        }
    }
    public IEnumerator&lt;a&gt; GetEnumerator()
    {
        yield return Some;
    }
    public static int Index
    {
        get { return 0; }
    }
    public static int Length
    {
        get { return Index &#43; 1; }
    }
    public STuple(a a)
    {
        x = a;
    }
}
public struct STuple&lt;a, b&gt;
{
    private readonly a x;
    private readonly STuple&lt;b&gt; s;
    public a Some
    {
        get { return x; }
    }
    public STuple&lt;b&gt; Rest
    {
        get { return s; }
    }
    public dynamic this[int index]
    {
        get
        {
            if (index &gt; Index || index &lt; 0)
                throw new IndexOutOfRangeException();
            else
                return index == Index
                    ? Some as dynamic
                    : Rest.Some as dynamic;
        }
    }
    public IEnumerator&lt;dynamic&gt; GetEnumerator()
    {
        yield return Some;
        yield return Rest.Some;
    }
    public static int Index
    {
        // C# forbids: (Rest.Index &#43; 1)
        get { return 1; }
    }
    public static int Length
    {
        get { return Index &#43; 1; }
    }
    public STuple(a a, b b)
    {
        x = a;
        s = new STuple&lt;b&gt;(b);
    }
}</pre>
<p></p>
<p>Example</p>
<p></p>
<pre class="brush: csharp">var a = new STuple&lt;int&gt;(3);
var b = new STuple&lt;int,int&gt;(1,2);
foreach (var x in a)
    Console.WriteLine(x);
foreach (object x in b)
    Console.WriteLine(x);
Console.ReadKey();
</pre>
<p></p>
<p>If we could somehow express a version of GetEnumerator that only applies to a homogeneous (s)tuple, meaning (s)tuple where all type parameters are equal, then there would be no need for a dynamic formulation, esp. as this is statically known.</p>
<p></p>
<pre class="brush: csharp">public static class STupleExtensions
{
    public static IEnumerator&lt;a&gt; GetEnumerator&lt;a&gt;(this STuple&lt;a, a&gt; s)
    {
        yield return s.Some;
        yield return s.Rest.Some;
    }
}
</pre>
<p></p>
<p>I realize though that this kind of trickery is probably not very high on any wishlist heh</p>
</div></blockquote>
<p>I would love to see a way to extend types beyond that awkward &quot;<em>first-parameter-with-this-modifier</em>&quot; trick.</p>
<p>For example this natural syntax would be awesome:</p>
<p>&nbsp;</p>
<p><font face="Consolas, 'Courier New', Courier, monospace"><span><font face="'Segoe UI', Verdana, Arial, Helvetica, sans-serif" size="3"><span></p>
<pre class="brush: csharp">
// 'class', 'struct', 'interface' or 'enum' keywords
// are useless here since the type already exists
public extension TypeToExtend
{	
     // 'public' modifier is useless here, as in any interface declaration
     void ExtensionMethod()
     {
          // the 'this' keyword is available here
          ...
     }</span></font></span></font>
<font face="Consolas, 'Courier New', Courier, monospace"><span><font face="'Segoe UI', Verdana, Arial, Helvetica, sans-serif" size="3"><span>
     static void StaticExtensionMethod()
     {
          // the 'this' keyword is NOT available here, as in any static method
          ...
     }</span></font></span></font>
<font face="Consolas, 'Courier New', Courier, monospace"><span><font face="'Segoe UI', Verdana, Arial, Helvetica, sans-serif" size="3"><span>
     void ExtensionProperty { get; set; }
}
</pre>
</span></font></span></font>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>As you can see it would allow &quot;<em>extension properties</em>&quot; and &quot;<em>extension static methods</em>&quot;.</p>
<p>You could&nbsp;even have &quot;<em>extension constructors</em>&quot;, &quot;<em>extension events</em>&quot; and so on...</p>
<p>Everything you could imagine to extend !</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/3751db34f3484bbb90859deb000989d8#3751db34f3484bbb90859deb000989d8</link>
		<pubDate>Wed, 18 Nov 2009 21:46:45 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/3751db34f3484bbb90859deb000989d8#3751db34f3484bbb90859deb000989d8</guid>
		<dc:creator>Ram</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/ramooon/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">ramooon said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I would love to see a way to extend types beyond that awkward &quot;<em>first-parameter-with-this-modifier</em>&quot; trick.</p>
<p>For example this natural syntax would be awesome:</p>
<p>&nbsp;</p>
<p><font face="Consolas, 'Courier New', Courier, monospace"><span><font face="'Segoe UI', Verdana, Arial, Helvetica, sans-serif" size="3"><span></p>
<pre class="brush: csharp">
// 'class', 'struct', 'interface' or 'enum' keywords
// are useless here since the type already exists
public extension TypeToExtend
{	
     // 'public' modifier is useless here, as in any interface declaration
     void ExtensionMethod()
     {
          // the 'this' keyword is available here
          ...
     }</span></font></span></font>
<font face="Consolas, 'Courier New', Courier, monospace"><span><font face="'Segoe UI', Verdana, Arial, Helvetica, sans-serif" size="3"><span>
     static void StaticExtensionMethod()
     {
          // the 'this' keyword is NOT available here, as in any static method
          ...
     }</span></font></span></font>
<font face="Consolas, 'Courier New', Courier, monospace"><span><font face="'Segoe UI', Verdana, Arial, Helvetica, sans-serif" size="3"><span>
     void ExtensionProperty { get; set; }
}
</pre>
</span></font></span></font>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>As you can see it would allow &quot;<em>extension properties</em>&quot; and &quot;<em>extension static methods</em>&quot;.</p>
<p>You could&nbsp;even have &quot;<em>extension constructors</em>&quot;, &quot;<em>extension events</em>&quot; and so on...</p>
<p>Everything you could imagine to extend !</p>
<p>&nbsp;</p>
</div></blockquote>
<p>Interesting idea. It looks like a more complete/holistic/uniform approach to type extension, kudos. It is reminiscent of partial classes, except not exclusive for classes. Now I wonder: if you have a partial class A and another partial class B in two distinct
 namespaces and say you have a simple console program and the console program imports partial class A; will partial class B then also implicitly be used or only if you explicitly import that namespace? In the latter case the partial class construct looks pretty
 darned close to what you want, except partial to classes, so to speak. Hindsight is great.</p>
<p>&nbsp;</p>
<p>As for public/private, private is probably a sign of imperativeness because in an imperative setting you want to be careful about who's modifying your object using your special helper methods whereas when constructing new objects it's not really that big
 of an issue and this default looks wrong for a mostly-declarative world (or functional if you will). This will also save lots of code having to explicitly declare public all over. Well... too late for C#, that ship sailed long ago.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f2c21d9c511740f9bdae9deb00098a06#f2c21d9c511740f9bdae9deb00098a06</link>
		<pubDate>Wed, 18 Nov 2009 23:06:12 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f2c21d9c511740f9bdae9deb00098a06#f2c21d9c511740f9bdae9deb00098a06</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">ramooon said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Interesting idea. It looks like a more complete/holistic/uniform approach to type extension, kudos. It is reminiscent of partial classes, except not exclusive for classes. Now I wonder: if you have a partial class A and another partial class B in two distinct
 namespaces and say you have a simple console program and the console program imports partial class A; will partial class B then also implicitly be used or only if you explicitly import that namespace? In the latter case the partial class construct looks pretty
 darned close to what you want, except partial to classes, so to speak. Hindsight is great.</p>
<p>&nbsp;</p>
<p>As for public/private, private is probably a sign of imperativeness because in an imperative setting you want to be careful about who's modifying your object using your special helper methods whereas when constructing new objects it's not really that big
 of an issue and this default looks wrong for a mostly-declarative world (or functional if you will). This will also save lots of code having to explicitly declare public all over. Well... too late for C#, that ship sailed long ago.</p>
</div></blockquote>
<p>Well, I'm not sure to understand what you said but the extensions would be available only if you import the right namespaces (ie. exactly the same behavior as the current syntax). The main benefit over partial classes is that it does not require &nbsp;the 'partial'
 keyword at the declaration site and it is not limited to classes therefore basically everything is extensible by default <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> What I didn't realize is that the partial keyword would become totally useless o_O ... right ?</p>
<p>&nbsp;</p>
<p>BTW Here's what I would like to see in future C# releases:</p>
<p>- Contracts: Spec# contracts built-in the language (with the bang non-null operator)</p>
<p>- Metaprogramming: a way to have user-defined keywords and syntax (ie. &nbsp;a 'keyword' keyword and so on)</p>
<p>- Immutablilty and Purity keywords</p>
<p>- Some more declarative and lazy stuffs -- I absolutely love LINQ</p>
<p>&nbsp;</p>
<p>Another idea, but IDE specific:</p>
<p>I wonder why although the IDE is now WPF based, it is still limited to classic characters ?</p>
<p>For example if I type something like &quot;--&gt;&quot; I would like the IDE to replace it with a real arrow.</p>
<p>This would allow custom symbols to be used in modern languages...</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/242df9fc03fa4f28b16b9deb00098a36#242df9fc03fa4f28b16b9deb00098a36</link>
		<pubDate>Thu, 19 Nov 2009 18:51:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/242df9fc03fa4f28b16b9deb00098a36#242df9fc03fa4f28b16b9deb00098a36</guid>
		<dc:creator>Ram</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/ramooon/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">ramooon said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Well, I'm not sure to understand what you said but the extensions would be available only if you import the right namespaces (ie. exactly the same behavior as the current syntax). The main benefit over partial classes is that it does not require &nbsp;the 'partial'
 keyword at the declaration site and it is not limited to classes therefore basically everything is extensible by default
<img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif" alt="Smiley"> What I didn't realize is that the partial keyword would become totally useless o_O ... right ?</p>
<p>&nbsp;</p>
<p>BTW Here's what I would like to see in future C# releases:</p>
<p>- Contracts: Spec# contracts built-in the language (with the bang non-null operator)</p>
<p>- Metaprogramming: a way to have user-defined keywords and syntax (ie. &nbsp;a 'keyword' keyword and so on)</p>
<p>- Immutablilty and Purity keywords</p>
<p>- Some more declarative and lazy stuffs -- I absolutely love LINQ</p>
<p>&nbsp;</p>
<p>Another idea, but IDE specific:</p>
<p>I wonder why although the IDE is now WPF based, it is still limited to classic characters ?</p>
<p>For example if I type something like &quot;--&gt;&quot; I would like the IDE to replace it with a real arrow.</p>
<p>This would allow custom symbols to be used in modern languages...</p>
<p>&nbsp;</p>
</div></blockquote>
<p>I'm not sure but on the face of it, it looks like your type extension idea would basically generalize and unite both partial classes and extension methods. Thumbs up. There may be gotchas but on the face of it, it looks very compelling.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/3f8f92fe336e46ceb2079deb00098a62#3f8f92fe336e46ceb2079deb00098a62</link>
		<pubDate>Fri, 20 Nov 2009 02:12:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/3f8f92fe336e46ceb2079deb00098a62#3f8f92fe336e46ceb2079deb00098a62</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">GrantB said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>There doesn't appear to be anything special about Go's notion of type equivalence beyond structural typing. C# has dynamic now, not sure the good folks want to go beyond that because dynamic allows you to apply the same programming pattern but in a less
 type-safe way. Another idea is to be able to coerce a type that structurally matches a different type into that type - a sort of structural cast.</p>
<p>&nbsp;</p>
<p>Love the idea behind persistent data structures.</p>
</div></blockquote>
<p>Would there be any value in this?</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: text">void f(dynamic IFoo arg)
{
	arg.foo();
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Where</p>
<p>(1) arg is of type dynamic</p>
<p>(2) the compiler warns when arg is used in a way not compatible with IFoo</p>
<p>(3) the compiler warns when an actual parameter does not implement method signatures isomorphic with IFoo</p>
<p>(4) the IDE provide arg with IFoo intellisense</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e48cc7c3509c4c019f329deb00098a8c#e48cc7c3509c4c019f329deb00098a8c</link>
		<pubDate>Fri, 20 Nov 2009 19:54:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e48cc7c3509c4c019f329deb00098a8c#e48cc7c3509c4c019f329deb00098a8c</guid>
		<dc:creator>Grant Boyle</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/GrantB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">GrantB said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Would there be any value in this?</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: text">void f(dynamic IFoo arg)
{
	arg.foo();
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Where</p>
<p>(1) arg is of type dynamic</p>
<p>(2) the compiler warns when arg is used in a way not compatible with IFoo</p>
<p>(3) the compiler warns when an actual parameter does not implement method signatures isomorphic with IFoo</p>
<p>(4) the IDE provide arg with IFoo intellisense</p>
</div></blockquote>
<p>generics?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/6fbaf6cfb3354e728a139deb00098ab4#6fbaf6cfb3354e728a139deb00098ab4</link>
		<pubDate>Sat, 21 Nov 2009 02:40:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/6fbaf6cfb3354e728a139deb00098ab4#6fbaf6cfb3354e728a139deb00098ab4</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Ion Todirel said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">GrantB said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>generics?</p>
</div></blockquote>
<p>No because that requires explicit association to IFoo whereas here we just need arg to
<em>match</em> IFoo.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/d560350bb48e4d52adf79deb00098adc#d560350bb48e4d52adf79deb00098adc</link>
		<pubDate>Sun, 22 Nov 2009 15:20:10 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/d560350bb48e4d52adf79deb00098adc#d560350bb48e4d52adf79deb00098adc</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Exceptions as part of type-signatures</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">int Div(int n, int d) throws DivisionByZeroException { if (d == 0) throw new DivisionByZeroException(); else return n / d; }</pre>
<p></p>
<p>&nbsp;</p>
<p>Now if a function of Div does not catch DivisionByZeroException, then it must declare that it throws it. Se we can always see in the function type if it is exception safe; that is, responsibility is clearly defined.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/69339ee924ad497a96389deb00098b03#69339ee924ad497a96389deb00098b03</link>
		<pubDate>Sun, 29 Nov 2009 12:09:20 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/69339ee924ad497a96389deb00098b03#69339ee924ad497a96389deb00098b03</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>Exceptions as part of type-signatures</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">int Div(int n, int d) throws DivisionByZeroException { if (d == 0) throw new DivisionByZeroException(); else return n / d; }</pre>
<p></p>
<p>&nbsp;</p>
<p>Now if a function of Div does not catch DivisionByZeroException, then it must declare that it throws it. Se we can always see in the function type if it is exception safe; that is, responsibility is clearly defined.</p>
</div></blockquote>
<p>I would argue that the compiler should just infer the potential exceptions vs java style manual decl.. plus code contracts go some way towards this, it would be nice to have more static analysis (including more 'bug be here' than just 'this won't compile')
 I'm sure the c# team would agree but of course its a lot easier to say it than make it happen.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9a6fe3cbdf72447d95099deb00098b2d#9a6fe3cbdf72447d95099deb00098b2d</link>
		<pubDate>Sun, 29 Nov 2009 12:14:08 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9a6fe3cbdf72447d95099deb00098b2d#9a6fe3cbdf72447d95099deb00098b2d</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>Exceptions as part of type-signatures</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">int Div(int n, int d) throws DivisionByZeroException { if (d == 0) throw new DivisionByZeroException(); else return n / d; }</pre>
<p></p>
<p>&nbsp;</p>
<p>Now if a function of Div does not catch DivisionByZeroException, then it must declare that it throws it. Se we can always see in the function type if it is exception safe; that is, responsibility is clearly defined.</p>
</div></blockquote>
<p>That is something they deliberately decided not to do when designing .Net.</p>
<p>&nbsp;</p>
<p>It's also impossible to add it now. Exception specifications only work if every single function uses them. If you allow interoperability with old code that doesn't have exception specifications, you'd need to have some way of dealing with situations where
 a method throws an exception which is not caught and not allowed by the specification of a method further up the chain. You'd get the same mess as in C&#43;&#43;.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/52e06ac74c5f47c4b2bf9deb00098b56#52e06ac74c5f47c4b2bf9deb00098b56</link>
		<pubDate>Sun, 29 Nov 2009 13:03:28 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/52e06ac74c5f47c4b2bf9deb00098b56#52e06ac74c5f47c4b2bf9deb00098b56</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Sven Groot said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>That is something they deliberately decided not to do when designing .Net.</p>
<p>&nbsp;</p>
<p>It's also impossible to add it now. Exception specifications only work if every single function uses them. If you allow interoperability with old code that doesn't have exception specifications, you'd need to have some way of dealing with situations where
 a method throws an exception which is not caught and not allowed by the specification of a method further up the chain. You'd get the same mess as in C&#43;&#43;.</p>
</div></blockquote>
<p>Yes, there'd had to be a strict and non-strict mode. You'd have to have your programs opt-in to it.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/bc0e44fb378a404eb93f9deb00098b7e#bc0e44fb378a404eb93f9deb00098b7e</link>
		<pubDate>Sun, 29 Nov 2009 13:42:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/bc0e44fb378a404eb93f9deb00098b7e#bc0e44fb378a404eb93f9deb00098b7e</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">stevo_ said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I would argue that the compiler should just infer the potential exceptions vs java style manual decl.. plus code contracts go some way towards this, it would be nice to have more static analysis (including more 'bug be here' than just 'this won't compile')
 I'm sure the c# team would agree but of course its a lot easier to say it than make it happen.</p>
</div></blockquote>
<p>I agree we should have more help from VS with this. There's really zero help here: at least it should be easy to say: these exceptions are not caught in the function you call, consider catching these, and of course refactoring in exception-safety by right-clicking
 on a function call and having it automatically catch every uncaught case; where static analysis proves what is not caught.</p>
<p>&nbsp;</p>
<p>On the other hand, there's probably also some benefits to expressing this explicitly. It may have been a deliberate choice to not have checked exceptions but maybe not the right choice.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f32208b6717842d389269deb00098bab#f32208b6717842d389269deb00098bab</link>
		<pubDate>Sun, 29 Nov 2009 13:48:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f32208b6717842d389269deb00098bab#f32208b6717842d389269deb00098bab</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>// deleted, wrong thread</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9754e318cb88427d94919deb00098bd1#9754e318cb88427d94919deb00098bd1</link>
		<pubDate>Wed, 20 Jan 2010 12:41:16 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9754e318cb88427d94919deb00098bd1#9754e318cb88427d94919deb00098bd1</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>// deleted, wrong thread</p>
</div></blockquote>
<p>It might have already been suggested, but I'd like to see base2 literals, which would be useful for writing Flags enums definitions without needing to think too much:</p>
<p>&nbsp;</p>
<p>I also want to see VC-style documentation inference. In VC it gets the comments on the same line as #defines and uses that, but in C# you have to use XML comments, which take up too much space and hamper visiblity.</p>
<p>&nbsp;</p>
<p>So this:</p>
<p>&nbsp;</p>
<p>[Flags]</p>
<p>public enum Whatever {</p>
<p>&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;Foo Fighters&lt;/summary&gt;</p>
<p>&nbsp;&nbsp;&nbsp; Foo = 0x10,</p>
<p>&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;So a blonde walks into a bar...&lt;/summary&gt;</p>
<p>&nbsp;&nbsp;&nbsp; Bar = 0x11</p>
<p>}</p>
<p>&nbsp;</p>
<p>Becomes:</p>
<p>&nbsp;</p>
<p>[Flags]</p>
<p>public enum Whatever {</p>
<p>&nbsp;&nbsp;&nbsp; Foo = 0b1010, // Foo fighters</p>
<p>&nbsp;&nbsp;&nbsp; Bar = 0b1011 // So a blond walks into a bar...</p>
<p>}</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7ee61ad75af24e7d88c09deb00098bfa#7ee61ad75af24e7d88c09deb00098bfa</link>
		<pubDate>Wed, 20 Jan 2010 13:18:11 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7ee61ad75af24e7d88c09deb00098bfa#7ee61ad75af24e7d88c09deb00098bfa</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>One might consider the Eiffel memoization support</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public once int Total
{
    get { ... }
}</pre>
<p></p>
<p>&nbsp;</p>
<p>On the other hand, maybe its entirely possible to implement this with attributes</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">[Memoize]
public int Total
{
    get { ... }
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Also, towards a more immutable world, is the current object construction syntax/semantics adequate? If you recursively initialize an object by setting properties, you have nice syntax a la JSon but the object is left open in a mutable state when you are
 done (or?). In a more immutable world one would then have to use very messy constructors, essentially with one parameter for every readonly/const member of a class that needs initialization. Even with named parameters this is not that nice; or maybe its good
 enough.</p>
<p>&nbsp;</p>
<p>Also, how about auto-implemented properties and immutability. Is it good enough with private set and public get? Should you be able to set a hint that a property be readonly, i.e. that it is only settable at construction time? e.g.</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public int Total
{
    get;
    set once;
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Or should the compiler just infer this and apply any benefits yielded by analysis (e.g. class verifiably supports imutability post-construction, even if not explicitly so). Or should there be a keyword a la</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public readonly class Person
{
    public string Name { get; set; } // settable, but only once, at construction time
    public uint Age { get; set; }
}</pre>
<p></p>
<p>&nbsp;</p>
<p>In some ways, just having readonly fields almost looks better</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: text">public class Person
{
    public static Person Parse(IEnumerable&lt;byte&gt; data)
    {
        return new Person()
        {
            Name = data.Take(20).ToAscii();
        }
    }
    public readonly string Name;
}
</pre>
<p></p>
<p>&nbsp;</p>
<p>But that's not legal C#.</p>
<p>&nbsp;</p>
<p>Some food for thought.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/001c53a4358445f3b91b9deb00098c2a#001c53a4358445f3b91b9deb00098c2a</link>
		<pubDate>Sun, 24 Jan 2010 22:47:22 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/001c53a4358445f3b91b9deb00098c2a#001c53a4358445f3b91b9deb00098c2a</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>I would like many features of Scala could be incorporated into C#. As that does not going to happen, I have my reduced wish list (with forgotten items, since I'm now somwhow dissapointed with C# road map - that's me).</p>
<p>&nbsp;</p>
<p>1 - Parameter-Level Interface Implementation; For example:</p>
<p></p>
<pre class="brush: csharp">class Person
{
    public string Name { get; set; }
    public int Age { get; }
}
interface IPersonata
{
    string Name { get; }
    int Age { get; }
}
class SomeTasks
{
    // ...
    void Function(static IPersonata p) { /* ... */ }
    // ...
    void AnotherFunction(Person p)
    {
        // ...
        Function(p);
        // ...
    }
}</pre>
<p></p>
<p>Should work; since Person satisfies IPersonata &quot;statically&quot;. This is something like Google Go languages does. If we use dynamic instead of static; then it should generate necessary parts at runtime.</p>
<p>&nbsp;</p>
<p>2 - Mixins (like Scala's Mixins); which in turn could lead to some statically typed meta-programming (well; It &quot;could&quot;; yet I am not sure how viable are these things in C#'s type system *).</p>
<p>&nbsp;</p>
<p>3 - Templating generics themselves; at least as type parameters, in interfaces:</p>
<p></p>
<pre class="brush: csharp">interface ITemplateBuilder&lt;T&gt;&lt;a&gt;
{
     T&lt;a&gt; CreateInstance(a arg);
}</pre>
<p></p>
<p>&nbsp;</p>
<p>4 - Stronger type inferance (*).</p>
<p>&nbsp;</p>
<p>5 - XAML everywhere! Yes! XAML could be a perfect replacement for macros in C#; and it's legal even for macro-hater C# folks (and some designers which I have not their eagle-eye view for sure; yet I like statically syntatic extension tools)! XAML provides
 a proper blending of aspects, services and data manipulation facilities.</p>
<p>&nbsp;</p>
<p>I have successfully implemented a kd tree (in fact a 2d tree!) for solving a GIS nearest neighbor finding algorithm and enjoyed it a lot; and it is really performant.</p>
<p>&nbsp;</p>
<p>But; the point that language designers should have in calculation more and more (as our problems get more complex and need quicker reactions):</p>
<p>&nbsp;</p>
<p>A programming language for sure consums time to bend the programmer's mind to it's concept. At one point this &quot;bending time&quot; will be costy enough for being abandoned by industry.</p>
<p>&nbsp;</p>
<p>One good job that Microsoft did; is releasing F#. Because if they intend to keep C# the way it is; they should leverage abstraction levels as new languages. F# is a wonderful language; yet a Scala blend (Maybe G# since G has one more angle than C!) could
 help more; since this &quot;syntax&quot; thing - and { } - really matters.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a59bef42cdc74fd1beb69deb00098c74#a59bef42cdc74fd1beb69deb00098c74</link>
		<pubDate>Wed, 27 Jan 2010 14:53:15 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a59bef42cdc74fd1beb69deb00098c74#a59bef42cdc74fd1beb69deb00098c74</guid>
		<dc:creator>kaveh.shahbazian@gmail.com</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/kaveh.shahbazian@gmail.com/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">kaveh.shahbazian@gmail.com said:</div><div class="quoteText">
<p>I would like many features of Scala could be incorporated into C#. As that does not going to happen, I have my reduced wish list (with forgotten items, since I'm now somwhow dissapointed with C# road map - that's me).</p>
<p>&nbsp;</p>
<p>1 - Parameter-Level Interface Implementation; For example:</p>
<p></p>
<pre class="brush: csharp">class Person
{
    public string Name { get; set; }
    public int Age { get; }
}
interface IPersonata
{
    string Name { get; }
    int Age { get; }
}
class SomeTasks
{
    // ...
    void Function(static IPersonata p) { /* ... */ }
    // ...
    void AnotherFunction(Person p)
    {
        // ...
        Function(p);
        // ...
    }
}</pre>
<p></p>
<p>Should work; since Person satisfies IPersonata &quot;statically&quot;. This is something like Google Go languages does. If we use dynamic instead of static; then it should generate necessary parts at runtime.</p>
<p>&nbsp;</p>
<p>2 - Mixins (like Scala's Mixins); which in turn could lead to some statically typed meta-programming (well; It &quot;could&quot;; yet I am not sure how viable are these things in C#'s type system *).</p>
<p>&nbsp;</p>
<p>3 - Templating generics themselves; at least as type parameters, in interfaces:</p>
<p></p>
<pre class="brush: csharp">interface ITemplateBuilder&lt;T&gt;&lt;a&gt;
{
     T&lt;a&gt; CreateInstance(a arg);
}</pre>
<p></p>
<p>&nbsp;</p>
<p>4 - Stronger type inferance (*).</p>
<p>&nbsp;</p>
<p>5 - XAML everywhere! Yes! XAML could be a perfect replacement for macros in C#; and it's legal even for macro-hater C# folks (and some designers which I have not their eagle-eye view for sure; yet I like statically syntatic extension tools)! XAML provides
 a proper blending of aspects, services and data manipulation facilities.</p>
<p>&nbsp;</p>
<p>I have successfully implemented a kd tree (in fact a 2d tree!) for solving a GIS nearest neighbor finding algorithm and enjoyed it a lot; and it is really performant.</p>
<p>&nbsp;</p>
<p>But; the point that language designers should have in calculation more and more (as our problems get more complex and need quicker reactions):</p>
<p>&nbsp;</p>
<p>A programming language for sure consums time to bend the programmer's mind to it's concept. At one point this &quot;bending time&quot; will be costy enough for being abandoned by industry.</p>
<p>&nbsp;</p>
<p>One good job that Microsoft did; is releasing F#. Because if they intend to keep C# the way it is; they should leverage abstraction levels as new languages. F# is a wonderful language; yet a Scala blend (Maybe G# since G has one more angle than C!) could
 help more; since this &quot;syntax&quot; thing - and { } - really matters.</p>
</div></blockquote>
<p>Scala was designed from the ground up with an object-functional theory in mind; C# is evolving towards functional style (with LINQ in particular) but even if we want C# to evolve I don't see C# ever becomming as smooth as Scala in this regard; it simply
 wasn't designed from the outset with this philosophy in mind.</p>
<p>&nbsp;</p>
<p>On the other hand it's probably not completely unreasonable to say that Microsoft wanted the equivalent of Java, fixing its inherent mistakes and improving it in various ways and then grew the idea further into an infrastructure for &quot;poly-linguistic execution&quot;
 although essentially founded on C# semantics (feel free to correct me.)</p>
<p>&nbsp;</p>
<p>This &quot;Parameter-Level Interface Implementation&quot; sounds to me like structural typing. That is indeed very desirable in some cases although you can emulate it with C# 4.0 dynamics - but I imagine loosing a lot of efficiency along the way.</p>
<p>&nbsp;</p>
<p>It would probably be more desirable to have a higher-kinded type system a la Haskell (higher-order generics or higher-order parametric polymorphism?)</p>
<p>&nbsp;</p>
<p><a href="http://en.wikipedia.org/wiki/Type_polymorphism">http://en.wikipedia.org/wiki/Type_polymorphism</a></p>
<p>&nbsp;</p>
<p>There has been some rumours that Microsoft is working on one more language. I believe Joe Duffy has been involved in this and maybe Erik Meijer as well. It's probably going to be pretty hard to beat Scala in generality and elegance but I remember a video
 with Joe Duffy and Erik Meijer discussing Linear Type Systems as a means to control effects within a concurrent world - or something to that effect. Maybe we can get an update some time on the current thinking within the company of what features are being
 thought of next.</p>
<p>&nbsp;</p>
<p>And of course we still have C# 5.0 on the horizon (and C# 4.0 is still not quite out of its eggshell yet.) I'm surprised you are disappointed at the C# roadmap because I haven't seen any roadmap so maybe you can point me to it - please!</p>
<p>&nbsp;</p>
<p>Still, functional programming has arrived in C# and its best realized in LINQ which is still evolving, at least on the library level. Rx is the latest and greatest example. So its power and impact is still unfolding.</p>
<p>&nbsp;</p>
<p><img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c906db218779421a84219deb00098caa#c906db218779421a84219deb00098caa</link>
		<pubDate>Wed, 27 Jan 2010 17:48:36 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c906db218779421a84219deb00098caa#c906db218779421a84219deb00098caa</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">kaveh.shahbazian@gmail.com said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Scala was designed from the ground up with an object-functional theory in mind; C# is evolving towards functional style (with LINQ in particular) but even if we want C# to evolve I don't see C# ever becomming as smooth as Scala in this regard; it simply
 wasn't designed from the outset with this philosophy in mind.</p>
<p>&nbsp;</p>
<p>On the other hand it's probably not completely unreasonable to say that Microsoft wanted the equivalent of Java, fixing its inherent mistakes and improving it in various ways and then grew the idea further into an infrastructure for &quot;poly-linguistic execution&quot;
 although essentially founded on C# semantics (feel free to correct me.)</p>
<p>&nbsp;</p>
<p>This &quot;Parameter-Level Interface Implementation&quot; sounds to me like structural typing. That is indeed very desirable in some cases although you can emulate it with C# 4.0 dynamics - but I imagine loosing a lot of efficiency along the way.</p>
<p>&nbsp;</p>
<p>It would probably be more desirable to have a higher-kinded type system a la Haskell (higher-order generics or higher-order parametric polymorphism?)</p>
<p>&nbsp;</p>
<p><a href="http://en.wikipedia.org/wiki/Type_polymorphism">http://en.wikipedia.org/wiki/Type_polymorphism</a></p>
<p>&nbsp;</p>
<p>There has been some rumours that Microsoft is working on one more language. I believe Joe Duffy has been involved in this and maybe Erik Meijer as well. It's probably going to be pretty hard to beat Scala in generality and elegance but I remember a video
 with Joe Duffy and Erik Meijer discussing Linear Type Systems as a means to control effects within a concurrent world - or something to that effect. Maybe we can get an update some time on the current thinking within the company of what features are being
 thought of next.</p>
<p>&nbsp;</p>
<p>And of course we still have C# 5.0 on the horizon (and C# 4.0 is still not quite out of its eggshell yet.) I'm surprised you are disappointed at the C# roadmap because I haven't seen any roadmap so maybe you can point me to it - please!</p>
<p>&nbsp;</p>
<p>Still, functional programming has arrived in C# and its best realized in LINQ which is still evolving, at least on the library level. Rx is the latest and greatest example. So its power and impact is still unfolding.</p>
<p>&nbsp;</p>
<p><img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif" alt="Smiley"></p>
</div></blockquote>
<p>@exoteric &nbsp;<br>
Thanks for your time and your informative and precise reply.<br>
<br>
i.<br>
First on my disappointment about C# roadmap: I always look into ways not only to separate subsystems; but also abstracting bunch of aspects among all layers. First tool I like it here is syntactic extension mechanism and meta-programming and the second one
 - which I enjoy it's presence at XAML (especially WPF) - is a neat and clean (I am not sure if this name is descriptive enough) &quot;aspect oriented&quot; programming model. In XAML you can think of providers, services that are presented through providers, (I did not
 see this anywhere else, so maybe I am wrong) a very well tailored and tailor-able implementation of prototype-based OO model, templating every “thing/aspect” even up to the sky, binding/plumbing/validating state and much more; and why I think it should be
 more than handy in a programming language? An example could be a common task: Logging! A huge noise scattered all around our code just to serve at different conceptual level (can you turn it off and on easily, safely, or remove it easily?)! After these long
 years no one stood up to tackle this and see this problem at language level (for sure there a Lisper out there who does not share my point of view). This is my first of first (!) and very valuable (conceptually at least) to me: C# as an abstraction layer &quot;on
 .NET&quot;; C# as a XSLT for aspects &quot;into .NET&quot; (90:00':00&quot;). I thought .NET team and C# team bring us more of it (and if anybody listens hear: we need more in-depth essays of WPF and the &quot;reason/philosophy&quot; behind each bit of it to learn it more deeply).<br>
Second (to be honest this second still has more deeply affected me than that first; maybe because it happens recently) reason of my disappointment is Scala. I melted down when I saw it: How is this possible? Even possible? I though these are elegant dreams!
 They should not exist in the real world! The second reason was: I &quot;believed&quot; something like Scala is &quot;impossible&quot;! Of-course your description of Scala way and &quot;logical/rational&quot; (political?) decisions about C#; are complete. Yet Scala provides a neat and clean
 statically typed meta-programming and even syntax manipulating environment.<br>
<br>
Again XAML is a source of well landed ideas! I like it! (OK, OK!)<br>
<br>
ii.<br>
A long time ago I thought about this &quot;Parameter-Level Interface Implementation&quot; thing in a different way. It was like some sort of &quot;something mimics something&quot; one-liner. Exactly as you mentioned, this idea changed in my mind when I was playing with C# 4.0
 dynamic to this &quot;Parameter-Level Interface Implementation&quot;. It's cool (and maybe exceptionally really immediately useful!).<br>
<br>
iii.<br>
I have played a little with Haskell and have a (maybe not so exact) clue of higher-kinded type-system; yet I think that's hard to achieve in C# semantics. But at interface level we can do more compiler tricks easily (correct me please if I am wrong).<br>
<br>
iv.<br>
It would be very nice to have some sources about that language you have spoke of. Thanks<br>
<br>
v.<br>
I have not looked into Rx so maybe I am wrong but it seems Rx should co-exists with some immutability facilities (like even an attribute, bundled with a compiler trick) in the language itself. Without that many problems (troubles) will still continue to exist
 in our code (is it possible for us to have uniqueness typing in C# or even in .NET?). And what about continuations? Does Rx provide a facility to use that seamlessly in our code? I have read some essays (maybe) which described that a language with exceptions
 can provide a richer model for dispatching that languages with continuations (in simple that idea is using different exceptions to reach different places in code - as I remember). So theorically we have a good bit of it. But do we have it built-in (not blotted-on)
 the language?<br>
<br>
Regards</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a6db3575887f4214bc969deb00098ce4#a6db3575887f4214bc969deb00098ce4</link>
		<pubDate>Wed, 27 Jan 2010 22:53:36 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a6db3575887f4214bc969deb00098ce4#a6db3575887f4214bc969deb00098ce4</guid>
		<dc:creator>kaveh.shahbazian@gmail.com</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/kaveh.shahbazian@gmail.com/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>I don't know about you, but I'd like <strong>inline assembly</strong> for time-critical sections of code.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/2638349815b249908be99deb00098d26#2638349815b249908be99deb00098d26</link>
		<pubDate>Fri, 29 Jan 2010 20:14:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/2638349815b249908be99deb00098d26#2638349815b249908be99deb00098d26</guid>
		<dc:creator>Zyrthofar</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Zyrthofar/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Zyrthofar said:</div><div class="quoteText">
<p>I don't know about you, but I'd like <strong>inline assembly</strong> for time-critical sections of code.</p>
</div></blockquote>
<p>Inline assembly defeats the point of C# as a cross-platform language. Whilst assemblies support mixed-mode with both CIL and Native instructions it makes it impossible to verify the correctness of the code, it's meant for interop and not performance.</p>
<p>&nbsp;</p>
<p>If you're doing time-critical programming do it in C/C&#43;&#43; without any CLR involvement.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c6c266db9cb843639f379deb00098d4d#c6c266db9cb843639f379deb00098d4d</link>
		<pubDate>Fri, 29 Jan 2010 21:36:14 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c6c266db9cb843639f379deb00098d4d#c6c266db9cb843639f379deb00098d4d</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">W3bbo said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Zyrthofar said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Inline assembly defeats the point of C# as a cross-platform language. Whilst assemblies support mixed-mode with both CIL and Native instructions it makes it impossible to verify the correctness of the code, it's meant for interop and not performance.</p>
<p>&nbsp;</p>
<p>If you're doing time-critical programming do it in C/C&#43;&#43; without any CLR involvement.</p>
</div></blockquote>
<p>Got it ^-^.</p>
<p>&nbsp;</p>
<p>Thanks</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/cc5dcf8afc354616af1d9deb00098d76#cc5dcf8afc354616af1d9deb00098d76</link>
		<pubDate>Sat, 30 Jan 2010 02:03:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/cc5dcf8afc354616af1d9deb00098d76#cc5dcf8afc354616af1d9deb00098d76</guid>
		<dc:creator>Zyrthofar</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Zyrthofar/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Open question. Should there be special support for this scenario?</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            var s1 = Enumerable.Range(1, 10);
            var s2 = s1.Select(x =&gt; x - 10);
            var s3 = Enumerable.Empty&lt;int&gt;();
            try
            {
                s3 = s1.Zip(s2, (a, b) =&gt; a / b);
            }
            catch (DivideByZeroException) // we'd like to catch the insect here
            {
                Console.WriteLine(&quot;got it&quot;);
            }
            foreach (var x in s3) // but this is where it shows itself
                Console.WriteLine(x);
            Console.ReadLine();
        }
    }
}
</pre>
<p></p>
<p>&nbsp;</p>
<p>It's quite easy to build extension methods to catch and handle exceptions and chain these on a LINQ expression. It just doesn't follow the normal syntax for dealing with exceptions.</p>
<p>&nbsp;</p>
<p>Hmm...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/13c4e295008b498fbdf89deb00098da0#13c4e295008b498fbdf89deb00098da0</link>
		<pubDate>Tue, 16 Feb 2010 20:06:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/13c4e295008b498fbdf89deb00098da0#13c4e295008b498fbdf89deb00098da0</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>Open question. Should there be special support for this scenario?</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            var s1 = Enumerable.Range(1, 10);
            var s2 = s1.Select(x =&gt; x - 10);
            var s3 = Enumerable.Empty&lt;int&gt;();
            try
            {
                s3 = s1.Zip(s2, (a, b) =&gt; a / b);
            }
            catch (DivideByZeroException) // we'd like to catch the insect here
            {
                Console.WriteLine(&quot;got it&quot;);
            }
            foreach (var x in s3) // but this is where it shows itself
                Console.WriteLine(x);
            Console.ReadLine();
        }
    }
}
</pre>
<p></p>
<p>&nbsp;</p>
<p>It's quite easy to build extension methods to catch and handle exceptions and chain these on a LINQ expression. It just doesn't follow the normal syntax for dealing with exceptions.</p>
<p>&nbsp;</p>
<p>Hmm...</p>
</div></blockquote>
<p>Hmm, well, that's the framework, not C#, but I think the issue here&nbsp;is accepting how enumerables work. If you really need to know
<em>right now</em> that nothing will cause the enumerable to throw then do something to materialize it
<em>right now</em>, like s1.Zip(...).ToArray(). Alternatively, because you know where the exception can happen just put your catch in the right place. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/201380c33cb64e5492c59deb00098dca#201380c33cb64e5492c59deb00098dca</link>
		<pubDate>Sat, 20 Feb 2010 17:23:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/201380c33cb64e5492c59deb00098dca#201380c33cb64e5492c59deb00098dca</guid>
		<dc:creator>Curt Nichols</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Curt Nichols/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Curt Nichols said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Hmm, well, that's the framework, not C#, but I think the issue here&nbsp;is accepting how enumerables work. If you really need to know
<em>right now</em> that nothing will cause the enumerable to throw then do something to materialize it
<em>right now</em>, like s1.Zip(...).ToArray(). Alternatively, because you know where the exception can happen just put your catch in the right place.
<img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif" alt="Smiley"></p>
</div></blockquote>
<p>It's actually a language issue with library design implications: to force exceptions to happen &quot;eagerly&quot; and therefore behave well with try/catch/finally, one often splits up methods in two parts: one for the iterator and another for the eager exception
 throwing.</p>
<p>&nbsp;</p>
<p>I can see the design choice: it's easy to say everything is lazy about an iterator. It's simpler and one should have good reasons to complicate the design.</p>
<p>&nbsp;</p>
<p>Doing ToArray is also not the answer if you have a stream that is either very long, very computationally expensive to exhaust, very IO expensive to exhaust - and maybe you don't even need all elements - that's part of what laziness allows you: to disregard
 non-needed elements, or maybe infinite.</p>
<p>&nbsp;</p>
<p>Maybe the answer isn't changing how iterators work (no can do) or introducing an eager code block syntax. Maybe the answer is just make try/catch live over the entire lifetime of an iterator that is allocated inside a try block. Maybe not.</p>
<p>&nbsp;</p>
<p>It's been forever since I used fxcop, maybe it has rules for such things heh.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c8e99407c50640479aab9deb00098df5#c8e99407c50640479aab9deb00098df5</link>
		<pubDate>Sat, 20 Feb 2010 18:03:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/c8e99407c50640479aab9deb00098df5#c8e99407c50640479aab9deb00098df5</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Have all Base Class Number Type and Numberic,</p>
<p>&nbsp;&nbsp;to Implement&nbsp;a common Interface ( INum )</p>
<p>&nbsp;or Inherit from a common base class&nbsp;(NumBase)&nbsp;&nbsp;&nbsp; Easy to remember as I've got a Numb *. (or the ruder version.</p>
<p>&nbsp;</p>
<p>So then you can implement a Generic methods just focused on numbers stuff and not have to reimplement it for each type.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/209a91b775ec485baa1b9deb00098e1c#209a91b775ec485baa1b9deb00098e1c</link>
		<pubDate>Sun, 21 Feb 2010 04:33:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/209a91b775ec485baa1b9deb00098e1c#209a91b775ec485baa1b9deb00098e1c</guid>
		<dc:creator>Adam Speight</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/AdamSpeight2008/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">AdamSpeight2008 said:</div><div class="quoteText">
<p>Have all Base Class Number Type and Numberic,</p>
<p>&nbsp;&nbsp;to Implement&nbsp;a common Interface ( INum )</p>
<p>&nbsp;or Inherit from a common base class&nbsp;(NumBase)&nbsp;&nbsp;&nbsp; Easy to remember as I've got a Numb *. (or the ruder version.</p>
<p>&nbsp;</p>
<p>So then you can implement a Generic methods just focused on numbers stuff and not have to reimplement it for each type.</p>
</div></blockquote>
<p>Generic math would be very sweet. I'm reminded of this pretty old Eiffel library by Chris Saunders that has always intrigued me, check out the superb use of code contracts:&nbsp;<a href="http://efsa.sourceforge.net/archive/saunders/math.htm">http://efsa.sourceforge.net/archive/saunders/math.htm</a>&nbsp;</p>
<p>&nbsp;</p>
<p>And one more idea. This one very desirable. Probably much more than most other suggestions (except perhaps for non-nullability)</p>
<p>&nbsp;</p>
<p>Flattened iterators in C#; &quot;yield foreach&quot; -&nbsp;<a href="http://blogs.msdn.com/wesdyer/archive/2007/03/23/all-about-iterators.aspx">Wes Dyer on Iterators</a>&nbsp;and Erik Meijer &amp; Co. on&nbsp;<a href="http://research.microsoft.com/en-us/projects/specsharp/iterators.pdf">Iterators
 revisited</a>. This should make tricks over enumerators unnecessary.&nbsp;I hope the concurrency focus won't drown that cool feature which will help a lot with performance and program elegance.</p>
<p><a href="http://blogs.msdn.com/wesdyer/archive/2007/03/23/all-about-iterators.aspx"></a></p>
<p><a href="http://blogs.msdn.com/wesdyer/archive/2007/03/23/all-about-iterators.aspx"></a></p>
<p><a href="http://blogs.msdn.com/wesdyer/archive/2007/03/23/all-about-iterators.aspx"></a></p>
<p><a href="http://blogs.msdn.com/wesdyer/archive/2007/03/23/all-about-iterators.aspx"></a></p>
<p><a href="http://efsa.sourceforge.net/archive/saunders/math.htm"></a></p>
<p><a href="http://efsa.sourceforge.net/archive/saunders/math.htm"></a></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e89c61e1823f4e638cd49deb00098e4b#e89c61e1823f4e638cd49deb00098e4b</link>
		<pubDate>Mon, 22 Feb 2010 10:05:17 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e89c61e1823f4e638cd49deb00098e4b#e89c61e1823f4e638cd49deb00098e4b</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>I have been playing with tuples but ran into an issue that made them not very useful to me...</p>
<p>&nbsp;</p>
<p>I have a class that is a performance timer, derived from Stopwatch. You can call Start and Stop on it multiple times and it has the following properties:</p>
<p>&nbsp;</p>
<p>Count - Total number of runs (int).<br>
Min&nbsp;&nbsp; - Minimum run lenght in seconds (float)<br>
Max&nbsp;&nbsp; - Maximum run lenght in seconds (float)<br>
Avg&nbsp;&nbsp; - Average run length in seconds (float)</p>
<p>&nbsp;</p>
<p>Pretty simple. But this class needs to be thread safe, for instance a background thread can be calling Start/Stop continuously, and the UI thread can be polling for results periodically. So just having simple properties does not work because the values can
 change while you are reading the properties one by one. So a tuple seems like a good plan, since I can use a lock to create the tuple that contains all values, making it thread safe.</p>
<p>&nbsp;</p>
<p>But here is the problem: Everywhere I used the tuple, I had to go back and see what the order of the&nbsp;items were. It is not enough to know that the 2nd&nbsp;item is a float, and the 3rd&nbsp;item is a float, etc. You can spell it out in the method summary so that the
 IDE picks that up, but it still seems prone to error.</p>
<p>&nbsp;</p>
<p>So I was thinking, how about a language feature where you can return a tuple like this:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp"> return Tuple.Create(Count = runCount, Min = runMin, Max = runMax, Avg = runAvg);</pre>
<p></p>
<p>&nbsp;</p>
<p>Then I can use it like:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">var result = SomeStopwatch.Results;
Console.WriteLine(&quot;Count = &quot; &#43; result.Count);
Console.WriteLine(&quot;Min = &quot; &#43; result.Min);
Console.WriteLine(&quot;Max = &quot; &#43; result.Max);
Console.WriteLine(&quot;Avg = &quot; &#43; result.Avg);</pre>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Not sure how possible something like that would be, but it would make it not only type safe (like it already is), but also less likely to get the items mixed up.</p>
<p>&nbsp;</p>
<p>Basically tuples with named items.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/642dfa3f47dd4668a5f99deb00098e7a#642dfa3f47dd4668a5f99deb00098e7a</link>
		<pubDate>Wed, 24 Feb 2010 02:02:50 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/642dfa3f47dd4668a5f99deb00098e7a#642dfa3f47dd4668a5f99deb00098e7a</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">BitFlipper said:</div><div class="quoteText">
<p>I have been playing with tuples but ran into an issue that made them not very useful to me...</p>
<p>&nbsp;</p>
<p>I have a class that is a performance timer, derived from Stopwatch. You can call Start and Stop on it multiple times and it has the following properties:</p>
<p>&nbsp;</p>
<p>Count - Total number of runs (int).<br>
Min&nbsp;&nbsp; - Minimum run lenght in seconds (float)<br>
Max&nbsp;&nbsp; - Maximum run lenght in seconds (float)<br>
Avg&nbsp;&nbsp; - Average run length in seconds (float)</p>
<p>&nbsp;</p>
<p>Pretty simple. But this class needs to be thread safe, for instance a background thread can be calling Start/Stop continuously, and the UI thread can be polling for results periodically. So just having simple properties does not work because the values can
 change while you are reading the properties one by one. So a tuple seems like a good plan, since I can use a lock to create the tuple that contains all values, making it thread safe.</p>
<p>&nbsp;</p>
<p>But here is the problem: Everywhere I used the tuple, I had to go back and see what the order of the&nbsp;items were. It is not enough to know that the 2nd&nbsp;item is a float, and the 3rd&nbsp;item is a float, etc. You can spell it out in the method summary so that the
 IDE picks that up, but it still seems prone to error.</p>
<p>&nbsp;</p>
<p>So I was thinking, how about a language feature where you can return a tuple like this:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp"> return Tuple.Create(Count = runCount, Min = runMin, Max = runMax, Avg = runAvg);</pre>
<p></p>
<p>&nbsp;</p>
<p>Then I can use it like:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">var result = SomeStopwatch.Results;
Console.WriteLine(&quot;Count = &quot; &#43; result.Count);
Console.WriteLine(&quot;Min = &quot; &#43; result.Min);
Console.WriteLine(&quot;Max = &quot; &#43; result.Max);
Console.WriteLine(&quot;Avg = &quot; &#43; result.Avg);</pre>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Not sure how possible something like that would be, but it would make it not only type safe (like it already is), but also less likely to get the items mixed up.</p>
<p>&nbsp;</p>
<p>Basically tuples with named items.</p>
</div></blockquote>
<p>Tuples with named items: sounds like records: sounds like classes - anonymous classes.</p>
<p>&nbsp;</p>
<p>Problem is, it doesn't seem possible (?) to return these literals from methods because to return them their type would have to be declared, making them that much less anonymous. Still, I think it would make sense to have something like this</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public static new { T X, T Y } Vector2&lt;T&gt;(this T k)
{
    return new { X = k, Y = k };
}
</pre>
<p></p>
<p>&nbsp;</p>
<p>On the other hand, it's pretty simple to create a simple class in your scenario. The tuple scenario is kind of like carrying along hidden metadata - or how would this statistics tuple look in a signature?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f3221ec9444c4e738bcb9deb00098eaa#f3221ec9444c4e738bcb9deb00098eaa</link>
		<pubDate>Wed, 24 Feb 2010 04:06:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f3221ec9444c4e738bcb9deb00098eaa#f3221ec9444c4e738bcb9deb00098eaa</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">BitFlipper said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Tuples with named items: sounds like records: sounds like classes - anonymous classes.</p>
<p>&nbsp;</p>
<p>Problem is, it doesn't seem possible (?) to return these literals from methods because to return them their type would have to be declared, making them that much less anonymous. Still, I think it would make sense to have something like this</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public static new { T X, T Y } Vector2&lt;T&gt;(this T k)
{
    return new { X = k, Y = k };
}
</pre>
<p></p>
<p>&nbsp;</p>
<p>On the other hand, it's pretty simple to create a simple class in your scenario. The tuple scenario is kind of like carrying along hidden metadata - or how would this statistics tuple look in a signature?</p>
</div></blockquote>
<p>Well, if you look at&nbsp;anonymous methods&nbsp;and captured variables etc, the compiler already creates anonymous classes in that case as you mention. We don't really care too much about the signature of these classes, since they are mostly hidden from us (although
 you can certainly see them in the debugger). In addition, when you use IEnumerable and yield return, the compiler infers the type from the return value. So if you combine those two concepts, you can basically have tuples with named items, right?</p>
<p>&nbsp;</p>
<p>So in my example, the type of &quot;result&quot;, would be&nbsp;something like &quot;&lt;Tuple&gt;a__1&quot; or whatever, but it would contain the&nbsp;public members&nbsp;with the correct names and types. Edit: And this is also what you would see if you used reflection to query the enclosing class's
 properties.</p>
<p>&nbsp;</p>
<p>BTW, in my example then it&nbsp;should really be returned like this:</p>
<p>&nbsp;</p>
<p><span class="keyword"></p>
<pre class="brush: text">public ITuple Result
{ 
    get { return (Count = runCount, Min = runMin, Max = runMax, Avg = runAvg); } 
}</pre>
</span>
<p></p>
<p>&nbsp;</p>
<p><span class="keyword">So just like you use IEnumerable when using yield return, you use ITuple, and the return type determines its true signature.</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/16e813ca2b8e48f49cdb9deb00098ed7#16e813ca2b8e48f49cdb9deb00098ed7</link>
		<pubDate>Wed, 24 Feb 2010 16:27:05 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/16e813ca2b8e48f49cdb9deb00098ed7#16e813ca2b8e48f49cdb9deb00098ed7</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">BitFlipper said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Well, if you look at&nbsp;anonymous methods&nbsp;and captured variables etc, the compiler already creates anonymous classes in that case as you mention. We don't really care too much about the signature of these classes, since they are mostly hidden from us (although
 you can certainly see them in the debugger). In addition, when you use IEnumerable and yield return, the compiler infers the type from the return value. So if you combine those two concepts, you can basically have tuples with named items, right?</p>
<p>&nbsp;</p>
<p>So in my example, the type of &quot;result&quot;, would be&nbsp;something like &quot;&lt;Tuple&gt;a__1&quot; or whatever, but it would contain the&nbsp;public members&nbsp;with the correct names and types. Edit: And this is also what you would see if you used reflection to query the enclosing class's
 properties.</p>
<p>&nbsp;</p>
<p>BTW, in my example then it&nbsp;should really be returned like this:</p>
<p>&nbsp;</p>
<p><span class="keyword"></p>
<pre class="brush: text">public ITuple Result
{ 
    get { return (Count = runCount, Min = runMin, Max = runMax, Avg = runAvg); } 
}</pre>
</span>
<p></p>
<p>&nbsp;</p>
<p><span class="keyword">So just like you use IEnumerable when using yield return, you use ITuple, and the return type determines its true signature.</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div></blockquote>
<p>This is very similar to anonymous types:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">var x = new { Count = runCount, Min = runMin, Max = runMax, Avg = runAvg };</pre>
<p></p>
<p>&nbsp;</p>
<p>The only difference is that anonymous types can only be used in a local scope. &nbsp;I think that you should be able to return them from methods. &nbsp;It is still just as type-safe but a lot more succinct:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public var GetAnonymous() {
  return new { Count = runCount, Min = runMin, Max = runMax, Avg = runAvg };
}</pre>
<p></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1cbb857ee93e411f98649deb00098f06#1cbb857ee93e411f98649deb00098f06</link>
		<pubDate>Wed, 24 Feb 2010 17:53:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1cbb857ee93e411f98649deb00098f06#1cbb857ee93e411f98649deb00098f06</guid>
		<dc:creator>ktr</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/ktr/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">ktr said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">BitFlipper said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>This is very similar to anonymous types:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">var x = new { Count = runCount, Min = runMin, Max = runMax, Avg = runAvg };</pre>
<p></p>
<p>&nbsp;</p>
<p>The only difference is that anonymous types can only be used in a local scope. &nbsp;I think that you should be able to return them from methods. &nbsp;It is still just as type-safe but a lot more succinct:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public var GetAnonymous() {
  return new { Count = runCount, Min = runMin, Max = runMax, Avg = runAvg };
}</pre>
<p></p>
</div></blockquote>
<p>Yes in that case you don't even need tuples any more. I guess the only time these dynamic &quot;tuples&quot; would be problematic is if you want to assign them to&nbsp;a pre-existing variable&nbsp;(in cases where you can't use&nbsp;&quot;var&quot;). But if they are strictly used for the purpose
 of return values, then that should&nbsp;not a problem.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>LOL, I think we can go even further then, by saying you can&nbsp;declare these tuples like this:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: text">private var&lt;int Count, float Min, float Max, float Avg&gt; m_result;</pre>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7f3d5094a323445c9c2a9deb00098f31#7f3d5094a323445c9c2a9deb00098f31</link>
		<pubDate>Wed, 24 Feb 2010 21:01:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7f3d5094a323445c9c2a9deb00098f31#7f3d5094a323445c9c2a9deb00098f31</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Personal top 3 in retrospect</p>
<p>&nbsp;</p>
<p><strong><em>Nested iterators</em></strong>&nbsp;(<a href="http://blogs.msdn.com/wesdyer/archive/2007/03/23/all-about-iterators.aspx">yield foreach</a>); a serious performance booster (and similar features to democratize
<em>LINQ to Objects; increasing their practicality to the extreme</em>)&nbsp;</p>
<p>&nbsp;</p>
<p><strong><em>Non-nullability</em></strong>; a serious correctness booster</p>
<p>&nbsp;</p>
<p><em><strong>Design by Contract sugar</strong></em>; a serious correctness booster (well with or without sugar of course)</p>
<p><em>requires</em><em>&nbsp;count &gt; 0</em><em>&nbsp;vs </em><em>Contract.Requires(count &gt; 0)</em></p>
<p><em>requires any: count &gt; 0 vs Contract.Requires(count &gt; 0, &quot;any&quot;)</em></p>
<p>&nbsp;</p>
<p>Your top 3?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a02e977516ce42e9bdbe9deb00098f5a#a02e977516ce42e9bdbe9deb00098f5a</link>
		<pubDate>Fri, 26 Feb 2010 06:43:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a02e977516ce42e9bdbe9deb00098f5a#a02e977516ce42e9bdbe9deb00098f5a</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>Personal top 3 in retrospect</p>
<p>&nbsp;</p>
<p><strong><em>Nested iterators</em></strong>&nbsp;(<a href="http://blogs.msdn.com/wesdyer/archive/2007/03/23/all-about-iterators.aspx">yield foreach</a>); a serious performance booster (and similar features to democratize
<em>LINQ to Objects; increasing their practicality to the extreme</em>)&nbsp;</p>
<p>&nbsp;</p>
<p><strong><em>Non-nullability</em></strong>; a serious correctness booster</p>
<p>&nbsp;</p>
<p><em><strong>Design by Contract sugar</strong></em>; a serious correctness booster (well with or without sugar of course)</p>
<p><em>requires</em><em>&nbsp;count &gt; 0</em><em>&nbsp;vs </em><em>Contract.Requires(count &gt; 0)</em></p>
<p><em>requires any: count &gt; 0 vs Contract.Requires(count &gt; 0, &quot;any&quot;)</em></p>
<p>&nbsp;</p>
<p>Your top 3?</p>
</div></blockquote>
<p>What do you mean by nested iterators? I ask because a while ago I wanted to create an iterator&nbsp;(using yield return) that enumerates all child nodes (including nested children) of a specified node. I created a recursive iterator and surprisingly it worked.</p>
<p>&nbsp;</p>
<p>Maybe you mean something else?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>EDIT:</strong> Nevermind. I think you were specifically talking about a performance improvement when using nested iterators...</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/6730391c54d346d198a79deb00098f84#6730391c54d346d198a79deb00098f84</link>
		<pubDate>Fri, 26 Feb 2010 07:22:19 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/6730391c54d346d198a79deb00098f84#6730391c54d346d198a79deb00098f84</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">BitFlipper said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>What do you mean by nested iterators? I ask because a while ago I wanted to create an iterator&nbsp;(using yield return) that enumerates all child nodes (including nested children) of a specified node. I created a recursive iterator and surprisingly it worked.</p>
<p>&nbsp;</p>
<p>Maybe you mean something else?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>EDIT:</strong> Nevermind. I think you were specifically talking about a performance improvement when using nested iterators...</p>
</div></blockquote>
<p>See <a href="http://citeseer.ist.psu.edu/cache/papers/cs2/355/http:zSzzSzwww.cs.kuleuven.ac.bezSz~frankzSzPAPERSzSzFTfJP2005.pdf/iterators-revisited-proof-rules.pdf">
this</a> paper.</p>
<p>&nbsp;</p>
<p>Iterators revisited: proof rules and implementation</p>
<p>Bart Jacobs, Erik Meijer, Frank Piessens, and Wolfram Schulte</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e99694985bda4623b3db9deb00098fae#e99694985bda4623b3db9deb00098fae</link>
		<pubDate>Fri, 26 Feb 2010 08:21:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/e99694985bda4623b3db9deb00098fae#e99694985bda4623b3db9deb00098fae</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>And another thread where I need to post so I can browse beyond page 1...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/333af4906e5148b489f29deb00098fd4#333af4906e5148b489f29deb00098fd4</link>
		<pubDate>Fri, 26 Feb 2010 16:50:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/333af4906e5148b489f29deb00098fd4#333af4906e5148b489f29deb00098fd4</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Sven Groot said:</div><div class="quoteText">
<p>And another thread where I need to post so I can browse beyond page 1...</p>
</div></blockquote>
<p>I believe one way to get around that bug is to right click on the &quot;next/last page&quot;&nbsp;button and select &quot;Open in new tab/window&quot;.&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>EDIT:</strong> I just noticed that sometimes those buttons are disabled, so the above suggestion&nbsp;doesn't always work. But I did find another trick: Scroll all the way to the top, then press F5 to refresh (dismiss any dialogs that might pop up). Then,
 while the page is still refreshing, the buttons will appear but will only stay enabled for a brief moment. If you then quickly click on one before the page completes loading, it should work.</p>
<p>&nbsp;</p>
<p>Man can they only get this thing right...?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/ba122a274ad64a90aa7a9deb00098ffc#ba122a274ad64a90aa7a9deb00098ffc</link>
		<pubDate>Fri, 26 Feb 2010 17:23:15 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/ba122a274ad64a90aa7a9deb00098ffc#ba122a274ad64a90aa7a9deb00098ffc</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Hmm...</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">    /// &lt;summary&gt;
    /// An optional value.
    /// &lt;/summary&gt;
    /// &lt;typeparam name=&quot;V&quot;&gt;The value type.&lt;/typeparam&gt;
    public struct Maybe&lt;V&gt;
    {
        public Maybe(bool exists, V value)
        {
            _exists = exists;
            _value = value;
        }
        public Maybe(Nullable&lt;V&gt; item) where V: struct
        {
            _exists = item.HasValue;
            if (_exists)
                _value = item.Value;
        }
        
        .....
     }</pre>
<p></p>
<p>&nbsp;</p>
<p>For constructors and implicit conversion operators it would be pretty nice if you could apply constrained genericity.</p>
<p>&nbsp;</p>
<p>Can't seem to do that. Possible?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7212ac3aa0e5492f98539deb00099024#7212ac3aa0e5492f98539deb00099024</link>
		<pubDate>Sun, 07 Mar 2010 03:25:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/7212ac3aa0e5492f98539deb00099024#7212ac3aa0e5492f98539deb00099024</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Replying because the thread was broken again...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f9d659c46bc341349b739deb0009904a#f9d659c46bc341349b739deb0009904a</link>
		<pubDate>Sun, 07 Mar 2010 14:39:56 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/f9d659c46bc341349b739deb0009904a#f9d659c46bc341349b739deb0009904a</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Sven Groot said:</div><div class="quoteText">
<p>Replying because the thread was broken again...</p>
</div></blockquote>
<p>How about this?</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public this_t Add(this_t other)
{
    ...
}</pre>
<p></p>
<p>&nbsp;</p>
<p>where this_t is of course the type of this.</p>
<p>&nbsp;</p>
<p>C# makes writing polymorphic numeric code living hell; e.g.</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">    public static class NumericEx
    {
        public static bool LessThan&lt;T, V&gt;(this T value1, T value2) where T : INumeric&lt;T, V&gt; { 
            return ...
        }
    }
</pre>
<p></p>
<p>&nbsp;</p>
<p>[edited]</p>
<p>&nbsp;</p>
<p>Calling the extension method one must supply the type parameters T and V explicitly, they will not be inferred.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1e4d6675ae1a4b43a1d19deb00099074#1e4d6675ae1a4b43a1d19deb00099074</link>
		<pubDate>Sun, 07 Mar 2010 18:14:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/1e4d6675ae1a4b43a1d19deb00099074#1e4d6675ae1a4b43a1d19deb00099074</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>This probably won't happen, but...</p>
<p>&nbsp;</p>
<p>I would like to see <strong>multiple inheritance</strong>&nbsp;with classes like in C&#43;&#43; supported within C#.</p>
<p>&nbsp;</p>
<p>Maybe I'm crazy, but I've felt the class-interface inheritance style wasn't very good....&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/38b3e145282245a6a4219deb000990b8#38b3e145282245a6a4219deb000990b8</link>
		<pubDate>Sun, 14 Mar 2010 23:19:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/38b3e145282245a6a4219deb000990b8#38b3e145282245a6a4219deb000990b8</guid>
		<dc:creator>LinWinOverlord</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/LinWinOverlord/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">LinWinOverlord said:</div><div class="quoteText">
<p>This probably won't happen, but...</p>
<p>&nbsp;</p>
<p>I would like to see <strong>multiple inheritance</strong>&nbsp;with classes like in C&#43;&#43; supported within C#.</p>
<p>&nbsp;</p>
<p>Maybe I'm crazy, but I've felt the class-interface inheritance style wasn't very good....&nbsp;</p>
</div></blockquote>
<p>BURN THE HERETIC!</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/4b780d6f1b424685872f9deb000990df#4b780d6f1b424685872f9deb000990df</link>
		<pubDate>Mon, 15 Mar 2010 12:55:27 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/4b780d6f1b424685872f9deb000990df#4b780d6f1b424685872f9deb000990df</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">W3bbo said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">LinWinOverlord said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>BURN THE HERETIC!</p>
</div></blockquote>
<p>Genuine LOL &nbsp;-- glad no-one was around to see.</p>
<p>&nbsp;</p>
<p>Herbie</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/13cbc27e88d8412086979deb00099106#13cbc27e88d8412086979deb00099106</link>
		<pubDate>Mon, 15 Mar 2010 21:45:18 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/13cbc27e88d8412086979deb00099106#13cbc27e88d8412086979deb00099106</guid>
		<dc:creator>Herbie Smith</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dr Herbie/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">LinWinOverlord said:</div><div class="quoteText">
<p>This probably won't happen, but...</p>
<p>&nbsp;</p>
<p>I would like to see <strong>multiple inheritance</strong>&nbsp;with classes like in C&#43;&#43; supported within C#.</p>
<p>&nbsp;</p>
<p>Maybe I'm crazy, but I've felt the class-interface inheritance style wasn't very good....&nbsp;</p>
</div></blockquote>
<p>And now for a more sincere response:</p>
<p>&nbsp;</p>
<p>Multiple-inheritance is a can of worms and introduces far more problems than it solves. Let's start off by saying this is actually impossible because the design of the CLR enforces single class inheritance. (Note this isn't to say some CIL compiler could
 hack it with interfaces and convulted behind-the-scenes design pattern generation),</p>
<p>&nbsp;</p>
<p>Generally speaking, if you're using MI then you're probably doing something wrong that can't be solved using Design Patterns.</p>
<p>&nbsp;</p>
<p>Show us some examples where you find yourself needing MI and we'll prove you wrong.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/88bc397ce59a4d82adb29deb0009912f#88bc397ce59a4d82adb29deb0009912f</link>
		<pubDate>Mon, 15 Mar 2010 23:04:19 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/88bc397ce59a4d82adb29deb0009912f#88bc397ce59a4d82adb29deb0009912f</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">W3bbo said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">LinWinOverlord said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>And now for a more sincere response:</p>
<p>&nbsp;</p>
<p>Multiple-inheritance is a can of worms and introduces far more problems than it solves. Let's start off by saying this is actually impossible because the design of the CLR enforces single class inheritance. (Note this isn't to say some CIL compiler could
 hack it with interfaces and convulted behind-the-scenes design pattern generation),</p>
<p>&nbsp;</p>
<p>Generally speaking, if you're using MI then you're probably doing something wrong that can't be solved using Design Patterns.</p>
<p>&nbsp;</p>
<p>Show us some examples where you find yourself needing MI and we'll prove you wrong.</p>
</div></blockquote>
<p><a href="http://msdn.microsoft.com/en-us/library/ms973898.aspx"></a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms973898.aspx"></a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms973898.aspx"></a></p>
<p><em>Describes the implementation and integration of the full power of the Eiffel language and method, including Design by Contract, multiple inheritance, genericity, and other advanced facilities, into the Microsoft .NET Framework, creating an environment
 that provides a best-of-breed solution for ambitious Internet software developers. (27 printed pages)</em></p>
<p>&nbsp;</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms973898.aspx">http://msdn.microsoft.com/en-us/library/ms973898.aspx</a>&nbsp;</p>
<p>&nbsp;</p>
<p>That was 2002. Eiffel of course predates this. Now in 2010 we see Design by Contract enter .Net - as a library construct. Maybe in a few years we'll see it in C#. Eiffel is like Scala - a highly harmonious integrated language where features play together;
 I'd say multiple inheritance is no exception although I'm no particular advocate of multiple inheritance. Powerful generics, constrained genericity, co- and contra-variance, covariant return types, etc. are more important to me.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms973898.aspx"></a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms973898.aspx"></a></p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/4a0c705e397e47e9b1b89deb0009915c#4a0c705e397e47e9b1b89deb0009915c</link>
		<pubDate>Mon, 15 Mar 2010 23:53:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/4a0c705e397e47e9b1b89deb0009915c#4a0c705e397e47e9b1b89deb0009915c</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Explicit, concealed laziness -</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public N Succ&lt;N&gt;(this N x) where N : INumeric&lt;N&gt;
{
    yield return x.Add(x.Unit);
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Nicely applicable to the implementation of lazy data structures and algorithms in general.</p>
<p>&nbsp;</p>
<p>And a couple of foobar ideas...</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">class Laz
{
    strict int X; // explicitly eager
    int Y; // implicitly either lazy or eager
    yield int Z; // explicitly lazy
    Laz()
    {
        X = yield Slow(); // error
        Y = yield Slow(); // ok, Y is now lazy
        Y = Slow(); // error, must assign yielded computation
        Z =Slow(); // error; Z is lazy, must assign yielded computation
    }
    ...
}</pre>
<p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/fde11ce009be49e19e299deb00099185#fde11ce009be49e19e299deb00099185</link>
		<pubDate>Sun, 21 Mar 2010 13:02:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/fde11ce009be49e19e299deb00099185#fde11ce009be49e19e299deb00099185</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p>Explicit, concealed laziness -</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public N Succ&lt;N&gt;(this N x) where N : INumeric&lt;N&gt;
{
    yield return x.Add(x.Unit);
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Nicely applicable to the implementation of lazy data structures and algorithms in general.</p>
<p>&nbsp;</p>
<p>And a couple of foobar ideas...</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">class Laz
{
    strict int X; // explicitly eager
    int Y; // implicitly either lazy or eager
    yield int Z; // explicitly lazy
    Laz()
    {
        X = yield Slow(); // error
        Y = yield Slow(); // ok, Y is now lazy
        Y = Slow(); // error, must assign yielded computation
        Z =Slow(); // error; Z is lazy, must assign yielded computation
    }
    ...
}</pre>
<p></p>
</div></blockquote>
<p>I'd really want grouped exceptions:</p>
<p>&nbsp;</p>
<p>try</p>
<p>{</p>
<p>}</p>
<p>catch (SocketException)</p>
<p>catch (WebException)</p>
<p>{</p>
<p>&nbsp;&nbsp; &nbsp;// some common handling here</p>
<p>}</p>
<p>&nbsp;</p>
<p>vs.</p>
<p>&nbsp;</p>
<p>try</p>
<p>{</p>
<p>}</p>
<p>catch (SocketException)</p>
<p>{</p>
<p>&nbsp;&nbsp; &nbsp;// some handling&nbsp;here</p>
<p>}</p>
<p>catch (WebException)</p>
<p>{</p>
<p>&nbsp;&nbsp; &nbsp;// same handling as above</p>
<p>}</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/b3a11bc550e74734b3b89deb000991ae#b3a11bc550e74734b3b89deb000991ae</link>
		<pubDate>Thu, 01 Apr 2010 05:37:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/b3a11bc550e74734b3b89deb000991ae#b3a11bc550e74734b3b89deb000991ae</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Ion Todirel said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I'd really want grouped exceptions:</p>
<p>&nbsp;</p>
<p>try</p>
<p>{</p>
<p>}</p>
<p>catch (SocketException)</p>
<p>catch (WebException)</p>
<p>{</p>
<p>&nbsp;&nbsp; &nbsp;// some common handling here</p>
<p>}</p>
<p>&nbsp;</p>
<p>vs.</p>
<p>&nbsp;</p>
<p>try</p>
<p>{</p>
<p>}</p>
<p>catch (SocketException)</p>
<p>{</p>
<p>&nbsp;&nbsp; &nbsp;// some handling&nbsp;here</p>
<p>}</p>
<p>catch (WebException)</p>
<p>{</p>
<p>&nbsp;&nbsp; &nbsp;// same handling as above</p>
<p>}</p>
</div></blockquote>
<p>or something like:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">
try
{ 
    ... 
}
catch (System.IO.FileLoadException, System.IO.FileNotFoundException)
{
    ...
}
</pre>
<p></p>
<p>&nbsp;</p>
<p>This is something I've been wanting for a while.&nbsp; I especially hate having one line of code catch blocks just because I needed to catch some random exception that&nbsp;I didn't want&nbsp;caught by System.Exception.&nbsp; Something like this would make things look cleaner
 I think.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/528034746c3343be87a99deb000991f4#528034746c3343be87a99deb000991f4</link>
		<pubDate>Wed, 07 Apr 2010 05:53:41 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/528034746c3343be87a99deb000991f4#528034746c3343be87a99deb000991f4</guid>
		<dc:creator>David Johnson</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Evok/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Evok said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Ion Todirel said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>or something like:</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">
try
{ 
    ... 
}
catch (System.IO.FileLoadException, System.IO.FileNotFoundException)
{
    ...
}
</pre>
<p></p>
<p>&nbsp;</p>
<p>This is something I've been wanting for a while.&nbsp; I especially hate having one line of code catch blocks just because I needed to catch some random exception that&nbsp;I didn't want&nbsp;caught by System.Exception.&nbsp; Something like this would make things look cleaner
 I think.</p>
</div></blockquote>
<p>That fails if your catch statement also defines an exception variable.</p>
<p>&nbsp;</p>
<p>Wht I'd like to see is something more like switch() statements, with fall-through:</p>
<p>&nbsp;</p>
<p>try {</p>
<p>&nbsp;</p>
<p>} catch(IOException) {</p>
<p>&nbsp;&nbsp;&nbsp; case FileNotFoundException fex: // variable 'fex' defined</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break; // break is optional</p>
<p>&nbsp;&nbsp;&nbsp; case FileLoadException: // no variable defined</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // message to user</p>
<p>&nbsp;&nbsp;&nbsp; default:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // IOException or some IOException subclass</p>
<p>} catch(StackOverflowException soex) {</p>
<p>&nbsp;</p>
<p>}</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/b3d888f1eb7049f5acac9deb00099222#b3d888f1eb7049f5acac9deb00099222</link>
		<pubDate>Wed, 07 Apr 2010 12:39:21 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/b3d888f1eb7049f5acac9deb00099222#b3d888f1eb7049f5acac9deb00099222</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">W3bbo said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Evok said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>That fails if your catch statement also defines an exception variable.</p>
<p>&nbsp;</p>
<p>Wht I'd like to see is something more like switch() statements, with fall-through:</p>
<p>&nbsp;</p>
<p>try {</p>
<p>&nbsp;</p>
<p>} catch(IOException) {</p>
<p>&nbsp;&nbsp;&nbsp; case FileNotFoundException fex: // variable 'fex' defined</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break; // break is optional</p>
<p>&nbsp;&nbsp;&nbsp; case FileLoadException: // no variable defined</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // message to user</p>
<p>&nbsp;&nbsp;&nbsp; default:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // IOException or some IOException subclass</p>
<p>} catch(StackOverflowException soex) {</p>
<p>&nbsp;</p>
<p>}</p>
<p>&nbsp;</p>
</div></blockquote>
<p>What do you mean fails? It'd just define multiple exception variables.</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">try
{ 
    ... 
}
catch (FileLoadException fle,FileNotFoundException fnfe)
{
    ...
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Still, I'm ambivalent about these syntaxes, Ion's is perhaps better.</p>
<p>&nbsp;</p>
<p>I don't like the concrete syntax you propose (in particular it looks messy and introduces a different looking syntax for inner exceptions; which happens to look like switch statements but is different; and which &nbsp;does not handle more than 2-levels of inheritance)
 although the idea of a more &quot;structured&quot; exception handling syntax may not be half-bad.</p>
<p>&nbsp;</p>
<p>A more sane approach may be to prefix exception names by ancestor - which is something the new Visual Studio might also be able to do visually using an extension; the nice thing here is that because we do not have multiple-inheritance of exceptions due to
 the fact that exceptions are class-based and we don't have multiple-class inheritance, we cannot get a multiple-parent conflict. Multiple-inheritance plus pattern matching over exceptions could be pretty interesting too.</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">try
{
   // ...
}
catch (FileException.FileNotFoundException e)
{
   // ...
}
catch (FileException.FileLoadException e)
{
   // ...
}
catch (SecurityException.AccessDeniedException e)
{
   // ...
}</pre>
<p></p>
<p>&nbsp;</p>
<p>Still, looks somewhat overkill. Let's get better static verification of exception handling first. (Maybe this too can be implemented as a VS extension which visually shows static analysis information about leaking exceptions: that is, uncaught exceptions.)</p>
<p>&nbsp;</p>
<p>As a note: In haXe enumerations can be recursive and switch be used to pattern patch over values. Exceptions might be implemented as enumerations (in a sense abstract datatypes) with some support keyword(s) for exception handling semantics as opposed to
 non-side-effecting, pure value pattern matching. Not sure this is a very good approach but it might be a good approach to unify some syntax... in some other language...</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/87a0969e72864c10a9179deb00099253#87a0969e72864c10a9179deb00099253</link>
		<pubDate>Thu, 08 Apr 2010 00:28:27 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/87a0969e72864c10a9179deb00099253#87a0969e72864c10a9179deb00099253</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Appears that C# has only very limited support toward the mix-in paradigm &nbsp;(ex, interfaces and extension methods). &nbsp;So, possibly, adding mix-in rich feature set would be a great addition to the language.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/231a8e0053ce45318f6d9deb00099295#231a8e0053ce45318f6d9deb00099295</link>
		<pubDate>Fri, 14 May 2010 10:58:11 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/231a8e0053ce45318f6d9deb00099295#231a8e0053ce45318f6d9deb00099295</guid>
		<dc:creator>Atlanta9</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Atlanta9/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Atlanta9 said:</div><div class="quoteText">
<p>Appears that C# has only very limited support toward the mix-in paradigm &nbsp;(ex, interfaces and extension methods). &nbsp;So, possibly, adding mix-in rich feature set would be a great addition to the language.</p>
</div></blockquote>
<p>No thanks. I hate extension methods as they are, not sure if I could live with mixins. If the implementation is nice, perhaps. Show us what syntax you had in mind.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9d466962647f4683a76a9deb000992bc#9d466962647f4683a76a9deb000992bc</link>
		<pubDate>Sat, 15 May 2010 03:25:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/9d466962647f4683a76a9deb000992bc#9d466962647f4683a76a9deb000992bc</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>How about making flag testing more simple with a new operator, so instead of</p>
<p></p>
<pre class="brush: text">if (a &amp; b == b)</pre>
<p></p>
<p></p>
<pre class="brush: text">if (a | b == a)</pre>
<p></p>
<p>you had a shorthand. Of course, you could think about it like the &#43;= and -= operators, and just shrink the expression:</p>
<p></p>
<pre class="brush: text">if (a &amp;== b) // a includes b</pre>
<p></p>
<p></p>
<pre class="brush: text">if (b |== a) // b is included in a</pre>
<p></p>
<p>but I think it would be more useful to give the expressions different meanings, so they would function like this:
</p>
<p></p>
<pre class="brush: text">if (a |== b) // any of the values of a ( 0x001 | 0x010 | 0x100 | etc.) is equal to any of the values in b</pre>
<p></p>
<p></p>
<pre class="brush: text">if (a &amp;== b) // the combined values of a ( 0x001 &amp; 0x010 &amp; 0x100 &amp; etc.) is equal to the combined values of b </pre>
<p></p>
<p></p>
<pre class="brush: text">if (a ^== b) // the excluded values of a ( 0x001 ^ 0x010 ^ 0x100 ^ etc.) are excluded from b</pre>
<p></p>
<p>then they could be reversed and still have the same meaning</p>
<p></p>
<pre class="brush: text">if (b |== a) // any of the values of a ( 0x001 | 0x010 | 0x100 | etc.) is equal to any of the values in b</pre>
<p></p>
<p></p>
<pre class="brush: text">if (b &amp;== a) // the combined values of a ( 0x001 &amp; 0x010 &amp; 0x100 &amp; etc.) is equal to the combined values of b </pre>
<p></p>
<p></p>
<pre class="brush: text">if (b ^== a) // the excluded values of a ( 0x001 ^ 0x010 ^ 0x100 ^ etc.) are excluded from b</pre>
<p></p>
<p>because it would also apply to the values of b and not just a</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a2b7aedd43404059b7449deb000992f0#a2b7aedd43404059b7449deb000992f0</link>
		<pubDate>Mon, 17 May 2010 01:26:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/a2b7aedd43404059b7449deb000992f0#a2b7aedd43404059b7449deb000992f0</guid>
		<dc:creator>brian.shapiro</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/brian.shapiro/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">brian.shapiro said:</div><div class="quoteText">
<p>How about making flag testing more simple with a new operator, so instead of</p>
<p></p>
<pre class="brush: text">if (a &amp; b == b)</pre>
<p></p>
<p></p>
<pre class="brush: text">if (a | b == a)</pre>
<p></p>
<p>you had a shorthand. Of course, you could think about it like the &#43;= and -= operators, and just shrink the expression:</p>
<p></p>
<pre class="brush: text">if (a &amp;== b) // a includes b</pre>
<p></p>
<p></p>
<pre class="brush: text">if (b |== a) // b is included in a</pre>
<p></p>
<p>but I think it would be more useful to give the expressions different meanings, so they would function like this:
</p>
<p></p>
<pre class="brush: text">if (a |== b) // any of the values of a ( 0x001 | 0x010 | 0x100 | etc.) is equal to any of the values in b</pre>
<p></p>
<p></p>
<pre class="brush: text">if (a &amp;== b) // the combined values of a ( 0x001 &amp; 0x010 &amp; 0x100 &amp; etc.) is equal to the combined values of b </pre>
<p></p>
<p></p>
<pre class="brush: text">if (a ^== b) // the excluded values of a ( 0x001 ^ 0x010 ^ 0x100 ^ etc.) are excluded from b</pre>
<p></p>
<p>then they could be reversed and still have the same meaning</p>
<p></p>
<pre class="brush: text">if (b |== a) // any of the values of a ( 0x001 | 0x010 | 0x100 | etc.) is equal to any of the values in b</pre>
<p></p>
<p></p>
<pre class="brush: text">if (b &amp;== a) // the combined values of a ( 0x001 &amp; 0x010 &amp; 0x100 &amp; etc.) is equal to the combined values of b </pre>
<p></p>
<p></p>
<pre class="brush: text">if (b ^== a) // the excluded values of a ( 0x001 ^ 0x010 ^ 0x100 ^ etc.) are excluded from b</pre>
<p></p>
<p>because it would also apply to the values of b and not just a</p>
</div></blockquote>
<p>I like your idea, but I find the second definitions a bit hard to follow (granted, it is 3am).</p>
<p>&nbsp;</p>
<p>I'm more interested in anything that takes away the verbose bitwise operations and additional parentheses. I don't get why bitwise operators are so low in the precedence table.</p>
<p>&nbsp;</p>
<p>&quot;(a &amp; b) == a&quot; can easily be read as &quot;a &amp; b == a&quot; as &quot;a &amp;&amp; b == a&quot; so I don't get the distinction.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/25f479554ca348bb98529deb0009931e#25f479554ca348bb98529deb0009931e</link>
		<pubDate>Mon, 17 May 2010 01:58:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/25f479554ca348bb98529deb0009931e#25f479554ca348bb98529deb0009931e</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">W3bbo said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">brian.shapiro said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I like your idea, but I find the second definitions a bit hard to follow (granted, it is 3am).</p>
<p>&nbsp;</p>
<p>I'm more interested in anything that takes away the verbose bitwise operations and additional parentheses. I don't get why bitwise operators are so low in the precedence table.</p>
<p>&nbsp;</p>
<p>&quot;(a &amp; b) == a&quot; can easily be read as &quot;a &amp; b == a&quot; as &quot;a &amp;&amp; b == a&quot; so I don't get the distinction.</p>
</div></blockquote>
<p>Yea I edited it to make it clear what I want to achieve. Its like a recursive logic/equational&nbsp;operation. The goal is just to make an equation thats bi-directional, so |== is different than &amp;==, and it also doesn't matter what side the variables are on.</p>
<p>&nbsp;</p>
<p>Except I guess its a little more complex than I'm making it sound like, because you'd also want to find (a | b) in (a | b | c) , so it has to be like a search operation.&nbsp;It can't be exactly like I described ... where any value on one side is equal to any
 value on the other side.. you have to search multiple values, and can't split a group to do a test.</p>
<p>&nbsp;</p>
<p>For OR, either (a | b) is in one of the groupings of (a | b | c), &nbsp;OR (a | b | c) is in one of the groupings of (a | b).</p>
<p>(a | b) = (a | b) OR (a | b) = (b | c) --- &nbsp;OR, (a | b | c) = ?</p>
<p>&nbsp;</p>
<p>Otherwise it may not work in two directions. I'm not sure how AND and XOR would work exactly.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/66def84d6c5d43ea84529deb00099349#66def84d6c5d43ea84529deb00099349</link>
		<pubDate>Mon, 17 May 2010 02:00:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/66def84d6c5d43ea84529deb00099349#66def84d6c5d43ea84529deb00099349</guid>
		<dc:creator>brian.shapiro</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/brian.shapiro/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">brian.shapiro said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">W3bbo said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Yea I edited it to make it clear what I want to achieve. Its like a recursive logic/equational&nbsp;operation. The goal is just to make an equation thats bi-directional, so |== is different than &amp;==, and it also doesn't matter what side the variables are on.</p>
<p>&nbsp;</p>
<p>Except I guess its a little more complex than I'm making it sound like, because you'd also want to find (a | b) in (a | b | c) , so it has to be like a search operation.&nbsp;It can't be exactly like I described ... where any value on one side is equal to any
 value on the other side.. you have to search multiple values, and can't split a group to do a test.</p>
<p>&nbsp;</p>
<p>For OR, either (a | b) is in one of the groupings of (a | b | c), &nbsp;OR (a | b | c) is in one of the groupings of (a | b).</p>
<p>(a | b) = (a | b) OR (a | b) = (b | c) --- &nbsp;OR, (a | b | c) = ?</p>
<p>&nbsp;</p>
<p>Otherwise it may not work in two directions. I'm not sure how AND and XOR would work exactly.</p>
</div></blockquote>
<p>I think if its shorthand like assignment operators, it should be collapsed the other way anyway</p>
<p></p>
<pre class="brush: text">if (b == a &amp; b)</pre>
<p></p>
<p></p>
<pre class="brush: text">if (a == a | b)</pre>
<p></p>
<p>to</p>
<p></p>
<pre class="brush: text">if (b &amp;== a) // b is included in a</pre>
<p></p>
<p></p>
<pre class="brush: text">if (a |== b) // a includes b</pre>
<p></p>
<p>&nbsp;</p>
<p>That feels better to me</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/77a1267243c04ff78c8f9deb00099378#77a1267243c04ff78c8f9deb00099378</link>
		<pubDate>Mon, 17 May 2010 02:46:49 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/77a1267243c04ff78c8f9deb00099378#77a1267243c04ff78c8f9deb00099378</guid>
		<dc:creator>brian.shapiro</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/brian.shapiro/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Posting cause I couldn't get to the last page again.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/100c1ca826534fdda5fe9deb0009939e#100c1ca826534fdda5fe9deb0009939e</link>
		<pubDate>Mon, 17 May 2010 04:11:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/100c1ca826534fdda5fe9deb0009939e#100c1ca826534fdda5fe9deb0009939e</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><em>Design by Contract</em> syntax also comes with some very useful keywords such as
<em><strong>old</strong></em>; in Eiffel the return value always has a name, called
<strong>Result</strong> (this, by the way, encourages structured programming where control flow is expressed with
<em><strong>if-then-else</strong></em>, making control flow visually clear via scoping), so there it is easy to refer to it when forming a post-condition; e.g.</p>
<p>&nbsp;</p>
<p><em><strong>&nbsp;&nbsp; &nbsp;ensures</strong></em></p>
<p><em><strong></strong>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;positive<strong>:</strong> result <strong>&gt;</strong> 0</em></p>
<p>&nbsp;</p>
<p>One simple function I've found extremely blissful for contract programming is <em>
<strong>implies</strong></em>, <a href="http://www.wolframalpha.com/input/?i=implies">
defined</a> as</p>
<p>&nbsp;</p>
<p><em><strong>&nbsp;&nbsp; &nbsp;implies </strong>a b <strong>=</strong> <strong>not</strong> a
<strong>or</strong> b</em></p>
<p>&nbsp;</p>
<p>As an example, transitivity expressed with implication/entailment:</p>
<p>&nbsp;</p>
<p><em><strong>&nbsp;&nbsp; &nbsp;(</strong>a <strong>&gt;</strong> b <strong>and </strong>b <strong>
&gt;</strong> c<strong>)</strong> <strong>implies (</strong>a <strong>&gt;</strong> c<strong>)</strong></em></p>
<p>&nbsp;</p>
<p>It's a bit of a shame we can use neither the natural words for logical operators, nor their symbolic representatives.</p>
<p>&nbsp;</p>
<p>I may sound like a broken record, always praising Eiffel but there's also much to be loved about C#. Iterators, lamda expressions and extension methods for example. It doesn't hurt to look around though. Contracts are a way to specify, constrain and verify
 the state machines we are surrounded with.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/2dae51dbd1b34f6c97829deb000993c9#2dae51dbd1b34f6c97829deb000993c9</link>
		<pubDate>Mon, 17 May 2010 19:34:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/2dae51dbd1b34f6c97829deb000993c9#2dae51dbd1b34f6c97829deb000993c9</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<p><em>Design by Contract</em> syntax also comes with some very useful keywords such as
<em><strong>old</strong></em>; in Eiffel the return value always has a name, called
<strong>Result</strong> (this, by the way, encourages structured programming where control flow is expressed with
<em><strong>if-then-else</strong></em>, making control flow visually clear via scoping), so there it is easy to refer to it when forming a post-condition; e.g.</p>
<p>&nbsp;</p>
<p><em><strong>&nbsp;&nbsp; &nbsp;ensures</strong></em></p>
<p><em><strong></strong>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;positive<strong>:</strong> result <strong>&gt;</strong> 0</em></p>
<p>&nbsp;</p>
<p>One simple function I've found extremely blissful for contract programming is <em>
<strong>implies</strong></em>, <a href="http://www.wolframalpha.com/input/?i=implies">
defined</a> as</p>
<p>&nbsp;</p>
<p><em><strong>&nbsp;&nbsp; &nbsp;implies </strong>a b <strong>=</strong> <strong>not</strong> a
<strong>or</strong> b</em></p>
<p>&nbsp;</p>
<p>As an example, transitivity expressed with implication/entailment:</p>
<p>&nbsp;</p>
<p><em><strong>&nbsp;&nbsp; &nbsp;(</strong>a <strong>&gt;</strong> b <strong>and </strong>b <strong>
&gt;</strong> c<strong>)</strong> <strong>implies (</strong>a <strong>&gt;</strong> c<strong>)</strong></em></p>
<p>&nbsp;</p>
<p>It's a bit of a shame we can use neither the natural words for logical operators, nor their symbolic representatives.</p>
<p>&nbsp;</p>
<p>I may sound like a broken record, always praising Eiffel but there's also much to be loved about C#. Iterators, lamda expressions and extension methods for example. It doesn't hurt to look around though. Contracts are a way to specify, constrain and verify
 the state machines we are surrounded with.</p>
</div></blockquote>
<p>I like the idea! But that&nbsp;doesn't&nbsp;fit with C# 's style, you want this:</p>
<p>&nbsp;</p>
<p><strong>ensures</strong>&nbsp;(result &gt; 0); // The result is within spec limits</p>
<p><strong>ensures immutable</strong> someLocalOrClassLevelMemebr; // The state doesn't change during method execution, this may be useful in&nbsp;multithreaded&nbsp;scenarios</p>
<p>&nbsp;</p>
<p><strong>require </strong>(arg1 &gt; 0 &amp;&amp; arg2 &lt; 10);</p>
<p><strong>require </strong>(arg1 /*string*/); // The compiler will emit code&nbsp;depending&nbsp;on&nbsp;the&nbsp;inputs, e.g. for string it would emit !String.IsNullOrWhitespace(arg1)</p>
<p>&nbsp;</p>
<p>Just dreaming. This probably never will get into C#.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/271e3031ddc9414d8a809deb000993f6#271e3031ddc9414d8a809deb000993f6</link>
		<pubDate>Mon, 17 May 2010 23:25:19 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/271e3031ddc9414d8a809deb000993f6#271e3031ddc9414d8a809deb000993f6</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Ion Todirel said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">exoteric said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>I like the idea! But that&nbsp;doesn't&nbsp;fit with C# 's style, you want this:</p>
<p>&nbsp;</p>
<p><strong>ensures</strong>&nbsp;(result &gt; 0); // The result is within spec limits</p>
<p><strong>ensures immutable</strong> someLocalOrClassLevelMemebr; // The state doesn't change during method execution, this may be useful in&nbsp;multithreaded&nbsp;scenarios</p>
<p>&nbsp;</p>
<p><strong>require </strong>(arg1 &gt; 0 &amp;&amp; arg2 &lt; 10);</p>
<p><strong>require </strong>(arg1 /*string*/); // The compiler will emit code&nbsp;depending&nbsp;on&nbsp;the&nbsp;inputs, e.g. for string it would emit !String.IsNullOrWhitespace(arg1)</p>
<p>&nbsp;</p>
<p>Just dreaming. This probably never will get into C#.</p>
</div></blockquote>
<p>Agreed; I just wrote it like that to show how nicely readable it is.&nbsp;I would prefer non-nullness at the type level (string! arg1) and stronger conditions in the contract (requires !arg1.IsWhitespace()).</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/aecd8c07e67842eb842c9deb00099420#aecd8c07e67842eb842c9deb00099420</link>
		<pubDate>Tue, 18 May 2010 07:30:08 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/aecd8c07e67842eb842c9deb00099420#aecd8c07e67842eb842c9deb00099420</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>The new Rx video made me think about deferred execution in LINQ.</p>
<p>&nbsp;</p>
<p>Bart mentions the Sum method which exits from the IEnumerable monad. As when you evaluate this expression</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">Enumerable.Range(0, 10).Sum()</pre>
<p></p>
<p>&nbsp;</p>
<p>the result is 45 but you have left the monad.</p>
<p>&nbsp;</p>
<p>Staying alive, in the monad, one might imagine this simple code</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">Enumerable.Range(0, 10).Sum2()</pre>
<p></p>
<p>&nbsp;</p>
<p>driven by these extension methods</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public static IEnumerable&lt;T&gt; Reduce&lt;S, T&gt;(this IEnumerable&lt;S&gt; source, Func&lt;IEnumerable&lt;S&gt;, T&gt; transform)
{
    yield return transform(source);
}
public static IEnumerable&lt;int&gt; Sum2(this IEnumerable&lt;int&gt; source)
{
    return source.Reduce(xs =&gt; xs.Sum());
}
</pre>
<p></p>
<p>&nbsp;</p>
<p>Now looking at this code I cannot help but wonder whether the Sum2 method should not be implementable as</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">public static IEnumerable&lt;int&gt; Sum2(this IEnumerable&lt;int&gt; source)
{
    return source.Reduce(Sum);
}
</pre>
<p></p>
<p>&nbsp;</p>
<p>or if that's too much magic. It should know the type of <em>source</em>&nbsp;and therefore also know about the extension methods available. See that one matches and resolve to use that.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/b02afaec271f4cacb1af9deb0009944e#b02afaec271f4cacb1af9deb0009944e</link>
		<pubDate>Tue, 18 May 2010 20:54:14 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/b02afaec271f4cacb1af9deb0009944e#b02afaec271f4cacb1af9deb0009944e</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Ideas for C# 5.0</title>
		<description><![CDATA[<p>Compile to native code.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/135253c7ddff460c9f769df60149473a#135253c7ddff460c9f769df60149473a</link>
		<pubDate>Sun, 19 Sep 2010 19:58:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/499699-Suggestions-for-C-50/135253c7ddff460c9f769df60149473a#135253c7ddff460c9f769df60149473a</guid>
		<dc:creator>Masoud Dehghani</dc:creator>
		<slash:comments>131</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Masoud/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>