<?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 - Discussions by ramooon</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Niners/ramooon/Discussions/RSS"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 - Discussions by ramooon</title>
		<link>http://channel9.msdn.com/Niners/ramooon/Discussions</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/Niners/ramooon/Discussions</link>
	<language>en</language>
	<pubDate>Thu, 20 Jun 2013 10:59:33 GMT</pubDate>
	<lastBuildDate>Thu, 20 Jun 2013 10:59:33 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>0</c9:totalResults>
	<c9:pageCount>0</c9:pageCount>
	<c9:pageSize>0</c9:pageSize>
	<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">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>
</channel>
</rss>