<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Where did the time go? - C# 4.0</title>
    <link>http://blog.j-maxx.net/</link>
    <description>Brain Powered</description>
    <language>en-us</language>
    <copyright>Jeff Klawiter</copyright>
    <lastBuildDate>Sun, 06 Jun 2010 00:17:49 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>Jeff.Klawiter@sierra-bravo.com</managingEditor>
    <webMaster>Jeff.Klawiter@sierra-bravo.com</webMaster>
    <item>
      <trackback:ping>http://blog.j-maxx.net/Trackback.aspx?guid=ddec503d-058c-4c14-8d31-140047924fe1</trackback:ping>
      <pingback:server>http://blog.j-maxx.net/pingback.aspx</pingback:server>
      <pingback:target>http://blog.j-maxx.net/PermaLink,guid,ddec503d-058c-4c14-8d31-140047924fe1.aspx</pingback:target>
      <dc:creator>Jeff Klawiter</dc:creator>
      <wfw:comment>http://blog.j-maxx.net/CommentView,guid,ddec503d-058c-4c14-8d31-140047924fe1.aspx</wfw:comment>
      <wfw:commentRss>http://blog.j-maxx.net/SyndicationService.asmx/GetEntryCommentsRss?guid=ddec503d-058c-4c14-8d31-140047924fe1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Recently I have added 4 new projects to SVN for Html Agility Pack. 
</p>
        <ol>
          <li>
            <a href="#HAPLight">HAPLight</a>: a Silverlight implementation 
</li>
          <li>
            <a href="#HAPCompact">HAPCompact</a>: a .NET CF 3.5 version 
</li>
          <li>
            <a href="#DotNet4">HAP for .NET 4.0</a>: taking advantage of DynamicObject. 
</li>
          <li>
            <a href="#UnitTests">Unit Tests</a>
          </li>
        </ol>
        <p>
All of these are works in progress and should be considered in alpha stages thus no
binary releases for them yet. To use them you’ll need to download them from SVN. <a title="http://htmlagilitypack.codeplex.com/SourceControl/list/changesets" href="http://htmlagilitypack.codeplex.com/SourceControl/list/changesets">http://htmlagilitypack.codeplex.com/SourceControl/list/changesets</a></p>
        <a name="HAPLight">
        </a>
        <h3>HAPLight
</h3>
        <p>
Bringing Html Agility Pack to Silverlight was relatively simple, thanks to Silverlight
supporting XPATH and XpathNavigator. There have been two losses so far, HtmlCmdLine
and HtmlWeb. HtmlWeb is a big loss and I don't plan on leaving it that way. Silverlight
requires all web requests to be Asyncronous which HtmlWeb surely is not. So at some
point I will be making a version of HtmlWeb that exposes Asynchronous methods for
downloading pages and returning them as HtmlDocuments. For now you can do this yourself
without much code using WebClient.DownloadstringAsync()
</p>
        <a name="HAPCompact">
        </a>
        <h3>HAPCompact
</h3>
        <p>
Again making a port of Html Agility Pack to .NET CF wasn't too difficult. One of the
biggest issues is .NET CF has no XPathNavigator support. There are no good free implementations
and I don't expect there ever will be. So HAPCompact will need to rely on using LINQ
to Objects. This project needs to be built with Visual Studio 2008. Unfortunately
VS2010 did not include any .NET compact framework support. I've been trying to look
into a way of taking advantage of VS2010's multi-targeting to add back in compilation
support. I have many projects at work that are in .NET CF 2.0 and 3.5.
</p>
        <a name="DotNet4">
        </a>
        <h3>Html Agility Pack for .NET 4.0
</h3>
        <p>
.NET 4.0 shipped with the Dynamic Language Runtime included. C# was updated in turn
to include a dynamic typing system. I thought it would be interesting to see if HAP
could take advantage of these features to dynamically access HtmlNodes and HtmlAttributes. 
This project so far is a partial class that makes HtmlNode inherit from DynamicObject.
This may change later to have it just implement an interface instead. The advantage
of this is you can access first level child nodes and attributes without . Something
like documentElement.Html.Body.Div to get the first &lt;div&gt; on the page.
</p>
        <p>
In C# to use these features you need to indicate the object is dynamic. Simply assigning
the node to a variable typed as dynamic will suffice. I had hoped to use @ for getting
attributes but found that it is completely lost so to access attributes a prefix of
_ is needed. Here are some examples taken from the unit tests:
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:f1fe2ef8-b4a8-49b3-b582-ac5596512217" class="wlWriterEditableSmartContent">
          <pre name="code" class="c#">[Test]
public void TestGetAttribute()
{
    var doc = new HtmlDocument();
    doc.LoadHtml("&lt;html&gt;&lt;body class=\"asdfasd\"&gt;&lt;p&gt;asdf asdf sdf&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;");
    dynamic docElement = doc.DocumentNode;
    var item = docElement.Html.Body._Class;
    Assert.IsNotNull(item);
    Assert.IsInstanceOf&lt;HtmlAttribute&gt;(item);
}

[Test]
public void TestGetMember()
{
    var doc = new HtmlDocument();
    doc.LoadHtml("&lt;html&gt;&lt;body&gt;&lt;p&gt;asdf asdf sdf&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;");
    dynamic docElement = doc.DocumentNode;
    var item = docElement.Html.Body;
    Assert.IsNotNull(item);
    Assert.IsInstanceOf&lt;HtmlNode&gt;(item);
}</pre>
        </div>
        <p>
        </p>
        <p>
        </p>
        <p>
Other ideas I’m having with this is to introduce some kind of domain specific language
for doing more specific accessing like documentElement.Html.Body.First_Div or documentElement.Html.Body.ById_Header
. This will be limited of course due to lack of symbols that could be used. 
</p>
        <a name="UnitTests">
        </a>
        <h3>Unit Tests
</h3>
        <p>
I’ve begun adding Unit Tests to Html Agility Pack. This will be a long process to
even approach a good code coverage percentage. There is quite a bit of code in the
library and some of it could use a good refactoring. So as I’m writing unit tests
I may be doing some refactoring as well. Along with this may come some introductions
of breaking changes with some of the methods or properties within the API. Thus this
next version may be 2.0.
</p>
        <img width="0" height="0" src="http://blog.j-maxx.net/aggbug.ashx?id=ddec503d-058c-4c14-8d31-140047924fe1" />
      </body>
      <title>New Html Agility Pack Versions and Features</title>
      <guid isPermaLink="false">http://blog.j-maxx.net/PermaLink,guid,ddec503d-058c-4c14-8d31-140047924fe1.aspx</guid>
      <link>http://blog.j-maxx.net/2010/06/06/NewHtmlAgilityPackVersionsAndFeatures.aspx</link>
      <pubDate>Sun, 06 Jun 2010 00:17:49 GMT</pubDate>
      <description>&lt;p&gt;
Recently I have added 4 new projects to SVN for Html Agility Pack. 
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;a href="#HAPLight"&gt;HAPLight&lt;/a&gt;: a Silverlight implementation 
&lt;/li&gt;
&lt;li&gt;
&lt;a href="#HAPCompact"&gt;HAPCompact&lt;/a&gt;: a .NET CF 3.5 version 
&lt;/li&gt;
&lt;li&gt;
&lt;a href="#DotNet4"&gt;HAP for .NET 4.0&lt;/a&gt;: taking advantage of DynamicObject. 
&lt;/li&gt;
&lt;li&gt;
&lt;a href="#UnitTests"&gt;Unit Tests&lt;/a&gt; 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
All of these are works in progress and should be considered in alpha stages thus no
binary releases for them yet. To use them you’ll need to download them from SVN. &lt;a title="http://htmlagilitypack.codeplex.com/SourceControl/list/changesets" href="http://htmlagilitypack.codeplex.com/SourceControl/list/changesets"&gt;http://htmlagilitypack.codeplex.com/SourceControl/list/changesets&lt;/a&gt;
&lt;/p&gt;
&lt;a name="HAPLight"&gt;&lt;/a&gt; 
&lt;h3&gt;HAPLight
&lt;/h3&gt;
&lt;p&gt;
Bringing Html Agility Pack to Silverlight was relatively simple, thanks to Silverlight
supporting XPATH and XpathNavigator. There have been two losses so far, HtmlCmdLine
and HtmlWeb. HtmlWeb is a big loss and I don't plan on leaving it that way. Silverlight
requires all web requests to be Asyncronous which HtmlWeb surely is not. So at some
point I will be making a version of HtmlWeb that exposes Asynchronous methods for
downloading pages and returning them as HtmlDocuments. For now you can do this yourself
without much code using WebClient.DownloadstringAsync()
&lt;/p&gt;
&lt;a name="HAPCompact"&gt;&lt;/a&gt; 
&lt;h3&gt;HAPCompact
&lt;/h3&gt;
&lt;p&gt;
Again making a port of Html Agility Pack to .NET CF wasn't too difficult. One of the
biggest issues is .NET CF has no XPathNavigator support. There are no good free implementations
and I don't expect there ever will be. So HAPCompact will need to rely on using LINQ
to Objects. This project needs to be built with Visual Studio 2008. Unfortunately
VS2010 did not include any .NET compact framework support. I've been trying to look
into a way of taking advantage of VS2010's multi-targeting to add back in compilation
support. I have many projects at work that are in .NET CF 2.0 and 3.5.
&lt;/p&gt;
&lt;a name="DotNet4"&gt;&lt;/a&gt; 
&lt;h3&gt;Html Agility Pack for .NET 4.0
&lt;/h3&gt;
&lt;p&gt;
.NET 4.0 shipped with the Dynamic Language Runtime included. C# was updated in turn
to include a dynamic typing system. I thought it would be interesting to see if HAP
could take advantage of these features to dynamically access HtmlNodes and HtmlAttributes.&amp;#160;
This project so far is a partial class that makes HtmlNode inherit from DynamicObject.
This may change later to have it just implement an interface instead. The advantage
of this is you can access first level child nodes and attributes without . Something
like documentElement.Html.Body.Div to get the first &amp;lt;div&amp;gt; on the page.
&lt;/p&gt;
&lt;p&gt;
In C# to use these features you need to indicate the object is dynamic. Simply assigning
the node to a variable typed as dynamic will suffice. I had hoped to use @ for getting
attributes but found that it is completely lost so to access attributes a prefix of
_ is needed. Here are some examples taken from the unit tests:
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:f1fe2ef8-b4a8-49b3-b582-ac5596512217" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="c#"&gt;[Test]
public void TestGetAttribute()
{
    var doc = new HtmlDocument();
    doc.LoadHtml("&amp;lt;html&amp;gt;&amp;lt;body class=\"asdfasd\"&amp;gt;&amp;lt;p&amp;gt;asdf asdf sdf&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;");
    dynamic docElement = doc.DocumentNode;
    var item = docElement.Html.Body._Class;
    Assert.IsNotNull(item);
    Assert.IsInstanceOf&amp;lt;HtmlAttribute&amp;gt;(item);
}

[Test]
public void TestGetMember()
{
    var doc = new HtmlDocument();
    doc.LoadHtml("&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;p&amp;gt;asdf asdf sdf&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;");
    dynamic docElement = doc.DocumentNode;
    var item = docElement.Html.Body;
    Assert.IsNotNull(item);
    Assert.IsInstanceOf&amp;lt;HtmlNode&amp;gt;(item);
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Other ideas I’m having with this is to introduce some kind of domain specific language
for doing more specific accessing like documentElement.Html.Body.First_Div or documentElement.Html.Body.ById_Header
. This will be limited of course due to lack of symbols that could be used. 
&lt;/p&gt;
&lt;a name="UnitTests"&gt;&lt;/a&gt; 
&lt;h3&gt;Unit Tests
&lt;/h3&gt;
&lt;p&gt;
I’ve begun adding Unit Tests to Html Agility Pack. This will be a long process to
even approach a good code coverage percentage. There is quite a bit of code in the
library and some of it could use a good refactoring. So as I’m writing unit tests
I may be doing some refactoring as well. Along with this may come some introductions
of breaking changes with some of the methods or properties within the API. Thus this
next version may be 2.0.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.j-maxx.net/aggbug.ashx?id=ddec503d-058c-4c14-8d31-140047924fe1" /&gt;</description>
      <comments>http://blog.j-maxx.net/CommentView,guid,ddec503d-058c-4c14-8d31-140047924fe1.aspx</comments>
      <category>C# 4.0</category>
      <category>Html Agility Pack</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://blog.j-maxx.net/Trackback.aspx?guid=0e8abe73-81d5-4db4-9115-2f8d2356f043</trackback:ping>
      <pingback:server>http://blog.j-maxx.net/pingback.aspx</pingback:server>
      <pingback:target>http://blog.j-maxx.net/PermaLink,guid,0e8abe73-81d5-4db4-9115-2f8d2356f043.aspx</pingback:target>
      <dc:creator>Jeff Klawiter</dc:creator>
      <wfw:comment>http://blog.j-maxx.net/CommentView,guid,0e8abe73-81d5-4db4-9115-2f8d2356f043.aspx</wfw:comment>
      <wfw:commentRss>http://blog.j-maxx.net/SyndicationService.asmx/GetEntryCommentsRss?guid=0e8abe73-81d5-4db4-9115-2f8d2356f043</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">All of these new C# 4.0 dynamic features
require parts of the DLR. Thus it looks like MS is taking the DLR and making it a
first class citizen in the CLR. This also I'm guessing will make IronPython and IronRuby
first class citizens as well. A huge win for the dynamic languages community. For
C# 4.0 it is bittersweet. It means better interoperability when calling things created
in IronRuby or IronPython but there are limitations. Below is an excerpt from the
C# 4.0 WhitePaper (available here <a href="http://code.msdn.microsoft.com/csharpfuture">http://code.msdn.microsoft.com/csharpfuture</a>)<br /><fieldset><style><!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Cambria;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073741899 0 0 159 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-pitch:fixed;
	mso-font-signature:-1610611985 1073750091 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
h2
	{mso-style-priority:9;
	mso-style-qformat:yes;
	mso-style-link:"Heading 2 Char";
	mso-style-next:Normal;
	margin-top:10.0pt;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	line-height:115%;
	mso-pagination:widow-orphan lines-together;
	page-break-after:avoid;
	mso-outline-level:2;
	font-size:13.0pt;
	font-family:"Cambria","serif";
	mso-ascii-font-family:Cambria;
	mso-ascii-theme-font:major-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:major-fareast;
	mso-hansi-font-family:Cambria;
	mso-hansi-theme-font:major-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:major-bidi;
	color:#4F81BD;
	mso-themecolor:accent1;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:.5in;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:.5in;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
span.Heading2Char
	{mso-style-name:"Heading 2 Char";
	mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-locked:yes;
	mso-style-link:"Heading 2";
	mso-ansi-font-size:13.0pt;
	mso-bidi-font-size:13.0pt;
	font-family:"Cambria","serif";
	mso-ascii-font-family:Cambria;
	mso-ascii-theme-font:major-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:major-fareast;
	mso-hansi-font-family:Cambria;
	mso-hansi-theme-font:major-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:major-bidi;
	color:#4F81BD;
	mso-themecolor:accent1;
	font-weight:bold;}
p.Code, li.Code, div.Code
	{mso-style-name:Code;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:.2in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:Consolas;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
span.Codefragment
	{mso-style-name:"Code fragment";
	mso-style-priority:1;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-ansi-font-size:10.0pt;
	font-family:Consolas;
	mso-ascii-font-family:Consolas;
	mso-hansi-font-family:Consolas;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:49888064;
	mso-list-type:hybrid;
	mso-list-template-ids:-372898770 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--></style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin-top:0in;
	mso-para-margin-right:0in;
	mso-para-margin-bottom:10.0pt;
	mso-para-margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;}
</style>
<![endif]--><h2>Open issues
</h2><p class="MsoNormal">
There are a few limitations and things that might work differently than you would
expect.
</p><p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in;"><!--[if !supportLists]--><span style="font-family: Symbol;"><span style="">·<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">         </span></span></span><!--[endif]-->The DLR allows objects to be created from objects that represent classes.
However, the current implementation of C# doesn’t have syntax to support this.
</p><p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"><!--[if !supportLists]--><span style="font-family: Symbol;"><span style="">·<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">         </span></span></span><!--[endif]-->Dynamic lookup will not be able to find extension methods. Whether extension
methods apply or not depends on the static context of the call (i.e. which using clauses
occur), and this context information is not currently kept as part of the payload.
</p><p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in;"><!--[if !supportLists]--><span style="font-family: Symbol;"><span style="">·<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">         </span></span></span><!--[endif]-->Anonymous functions (i.e. lambda expressions) cannot appear as arguments
to a dynamic method call. The compiler cannot bind (i.e. “understand”) an anonymous
function without knowing what type it is converted to.
</p><p class="MsoNormal">
One consequence of these limitations is that you cannot easily use LINQ queries over
dynamic objects:
</p><p class="Code">
dynamic collection = …;
</p><p class="Code">
var result = collection.Select(e =&gt; e + 5);
</p><p class="MsoNormal">
If the <span class="Codefragment"><span style="font-size: 10pt; line-height: 115%;">Select</span></span> method
is an extension method, dynamic lookup will not find it. Even if it is an instance
method, the above does not compile, because a lambda expression cannot be passed as
an argument to a dynamic operation.
</p><p class="MsoNormal">
There are no plans to address these limitations in C# 4.0.
</p></fieldset><br />
To me this is a very huge limitation. I can already see that most of my interop with
dynamic languages will probably involve collections of some sort. Also this would
come into play with collections from Dynamic COM objects. LINQ is so powerful and
easy to use, it may end up being a major annoyance to have to move away from it for
dynamic typing. I hope they work on this for C# 4.5<br /><br /><br /><p></p><img width="0" height="0" src="http://blog.j-maxx.net/aggbug.ashx?id=0e8abe73-81d5-4db4-9115-2f8d2356f043" /></body>
      <title>CLR 4.0 to include the DLR - With Limitations</title>
      <guid isPermaLink="false">http://blog.j-maxx.net/PermaLink,guid,0e8abe73-81d5-4db4-9115-2f8d2356f043.aspx</guid>
      <link>http://blog.j-maxx.net/2008/10/28/CLR40ToIncludeTheDLRWithLimitations.aspx</link>
      <pubDate>Tue, 28 Oct 2008 16:23:43 GMT</pubDate>
      <description>All of these new C# 4.0 dynamic features require parts of the DLR. Thus it looks like MS is taking the DLR and making it a first class citizen in the CLR. This also I'm guessing will make IronPython and IronRuby first class citizens as well. A huge win for the dynamic languages community. For C# 4.0 it is bittersweet. It means better interoperability when calling things created in IronRuby or IronPython but there are limitations. Below is an excerpt from the C# 4.0 WhitePaper (available here &lt;a href="http://code.msdn.microsoft.com/csharpfuture"&gt;http://code.msdn.microsoft.com/csharpfuture&lt;/a&gt;)&lt;br&gt;
&lt;fieldset&gt;
&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Cambria;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073741899 0 0 159 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-pitch:fixed;
	mso-font-signature:-1610611985 1073750091 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
h2
	{mso-style-priority:9;
	mso-style-qformat:yes;
	mso-style-link:"Heading 2 Char";
	mso-style-next:Normal;
	margin-top:10.0pt;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	line-height:115%;
	mso-pagination:widow-orphan lines-together;
	page-break-after:avoid;
	mso-outline-level:2;
	font-size:13.0pt;
	font-family:"Cambria","serif";
	mso-ascii-font-family:Cambria;
	mso-ascii-theme-font:major-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:major-fareast;
	mso-hansi-font-family:Cambria;
	mso-hansi-theme-font:major-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:major-bidi;
	color:#4F81BD;
	mso-themecolor:accent1;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:.5in;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:.5in;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
span.Heading2Char
	{mso-style-name:"Heading 2 Char";
	mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-locked:yes;
	mso-style-link:"Heading 2";
	mso-ansi-font-size:13.0pt;
	mso-bidi-font-size:13.0pt;
	font-family:"Cambria","serif";
	mso-ascii-font-family:Cambria;
	mso-ascii-theme-font:major-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:major-fareast;
	mso-hansi-font-family:Cambria;
	mso-hansi-theme-font:major-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:major-bidi;
	color:#4F81BD;
	mso-themecolor:accent1;
	font-weight:bold;}
p.Code, li.Code, div.Code
	{mso-style-name:Code;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:.2in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:Consolas;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
span.Codefragment
	{mso-style-name:"Code fragment";
	mso-style-priority:1;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-ansi-font-size:10.0pt;
	font-family:Consolas;
	mso-ascii-font-family:Consolas;
	mso-hansi-font-family:Consolas;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:49888064;
	mso-list-type:hybrid;
	mso-list-template-ids:-372898770 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--&gt;
&lt;/style&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin-top:0in;
	mso-para-margin-right:0in;
	mso-para-margin-bottom:10.0pt;
	mso-para-margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;h2&gt;Open issues
&lt;/h2&gt;
&lt;p class="MsoNormal"&gt;
There are a few limitations and things that might work differently than you would
expect.
&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in;"&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;!--[endif]--&gt;The DLR allows objects to be created from objects that represent classes.
However, the current implementation of C# doesn’t have syntax to support this.
&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;!--[endif]--&gt;Dynamic lookup will not be able to find extension methods. Whether extension
methods apply or not depends on the static context of the call (i.e. which using clauses
occur), and this context information is not currently kept as part of the payload.
&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in;"&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;!--[endif]--&gt;Anonymous functions (i.e. lambda expressions) cannot appear as arguments
to a dynamic method call. The compiler cannot bind (i.e. “understand”) an anonymous
function without knowing what type it is converted to.
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
One consequence of these limitations is that you cannot easily use LINQ queries over
dynamic objects:
&lt;/p&gt;
&lt;p class="Code"&gt;
dynamic collection = …;
&lt;/p&gt;
&lt;p class="Code"&gt;
var result = collection.Select(e =&amp;gt; e + 5);
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
If the &lt;span class="Codefragment"&gt;&lt;span style="font-size: 10pt; line-height: 115%;"&gt;Select&lt;/span&gt;&lt;/span&gt; method
is an extension method, dynamic lookup will not find it. Even if it is an instance
method, the above does not compile, because a lambda expression cannot be passed as
an argument to a dynamic operation.
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
There are no plans to address these limitations in C# 4.0.
&lt;/p&gt;
&lt;/fieldset&gt;
&lt;br&gt;
To me this is a very huge limitation. I can already see that most of my interop with
dynamic languages will probably involve collections of some sort. Also this would
come into play with collections from Dynamic COM objects. LINQ is so powerful and
easy to use, it may end up being a major annoyance to have to move away from it for
dynamic typing. I hope they work on this for C# 4.5&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.j-maxx.net/aggbug.ashx?id=0e8abe73-81d5-4db4-9115-2f8d2356f043" /&gt;</description>
      <comments>http://blog.j-maxx.net/CommentView,guid,0e8abe73-81d5-4db4-9115-2f8d2356f043.aspx</comments>
      <category>C# 4.0</category>
    </item>
    <item>
      <trackback:ping>http://blog.j-maxx.net/Trackback.aspx?guid=4615cd55-a3f0-4d8e-9131-f82995cf1470</trackback:ping>
      <pingback:server>http://blog.j-maxx.net/pingback.aspx</pingback:server>
      <pingback:target>http://blog.j-maxx.net/PermaLink,guid,4615cd55-a3f0-4d8e-9131-f82995cf1470.aspx</pingback:target>
      <dc:creator>Jeff Klawiter</dc:creator>
      <wfw:comment>http://blog.j-maxx.net/CommentView,guid,4615cd55-a3f0-4d8e-9131-f82995cf1470.aspx</wfw:comment>
      <wfw:commentRss>http://blog.j-maxx.net/SyndicationService.asmx/GetEntryCommentsRss?guid=4615cd55-a3f0-4d8e-9131-f82995cf1470</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">While browsing through MSDN blogs I came
across this nice little post. <a href="http://blogs.msdn.com/dparys/archive/2008/10/28/neue-m-glichkeiten-in-c-4-0.aspx">http://blogs.msdn.com/dparys/archive/2008/10/28/neue-m-glichkeiten-in-c-4-0.aspx</a> .
After translating the page I found that he linked to the new C# 40 page <a href="http://code.msdn.microsoft.com/csharpfuture">http://code.msdn.microsoft.com/csharpfuture</a><br /><br />
I played around with VS 2010 last night. I was able to test the dynamic keyword. It
works as advertised but the biggest thing one has to realize is using it removes intellisense
for that variable. Compiling type safety as well. I hope they'll be able to add some
sort of limited intellisense by looking at the last assigned type.<br /><br />
Also on the Dynamic front is DynamicObject. A new base object type that allows for
on the fly Property declaration. The DynamicObject uses a PropertyBag (looks like
a Dictionary&lt;string,object&gt;). You can declare properties on the fly. Like<br /><pre name="code" class="c#">public class MyBag : DynamicObject
{
// überschreibt Getter / Setter
} 
dynamic b = new MyBag();
b.Id = 124;
b.Name = "Windows 7"
b.Price = 499.99m;
b.IsAvailable = false;

</pre>One
thing I was unable to figure out was the optional, default and named parameters. Again
the blog provided some answers.<br /><br /><pre name="code" class="c#">public void InsertCustomer( int customerId,
                          string companyName = "Neue Firma",
                          decimal creditLimit = 2000m )
{
}

InsertCustomer( 1, creditLimit: 2000m );  

InsertCustomer( creditLimit: 2000m, customerId: 1 );

</pre><br /><br /><br /><br /><p></p><img width="0" height="0" src="http://blog.j-maxx.net/aggbug.ashx?id=4615cd55-a3f0-4d8e-9131-f82995cf1470" /></body>
      <title>Update on new C# 4 features</title>
      <guid isPermaLink="false">http://blog.j-maxx.net/PermaLink,guid,4615cd55-a3f0-4d8e-9131-f82995cf1470.aspx</guid>
      <link>http://blog.j-maxx.net/2008/10/28/UpdateOnNewC4Features.aspx</link>
      <pubDate>Tue, 28 Oct 2008 14:13:13 GMT</pubDate>
      <description>While browsing through MSDN blogs I came across this nice little post. &lt;a href="http://blogs.msdn.com/dparys/archive/2008/10/28/neue-m-glichkeiten-in-c-4-0.aspx"&gt;http://blogs.msdn.com/dparys/archive/2008/10/28/neue-m-glichkeiten-in-c-4-0.aspx&lt;/a&gt; .
After translating the page I found that he linked to the new C# 40 page &lt;a href="http://code.msdn.microsoft.com/csharpfuture"&gt;http://code.msdn.microsoft.com/csharpfuture&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
I played around with VS 2010 last night. I was able to test the dynamic keyword. It
works as advertised but the biggest thing one has to realize is using it removes intellisense
for that variable. Compiling type safety as well. I hope they'll be able to add some
sort of limited intellisense by looking at the last assigned type.&lt;br&gt;
&lt;br&gt;
Also on the Dynamic front is DynamicObject. A new base object type that allows for
on the fly Property declaration. The DynamicObject uses a PropertyBag (looks like
a Dictionary&amp;lt;string,object&amp;gt;). You can declare properties on the fly. Like&lt;br&gt;
&lt;pre name="code" class="c#"&gt;public class MyBag : DynamicObject
{
// überschreibt Getter / Setter
} 
dynamic b = new MyBag();
b.Id = 124;
b.Name = "Windows 7"
b.Price = 499.99m;
b.IsAvailable = false;

&lt;/pre&gt;One
thing I was unable to figure out was the optional, default and named parameters. Again
the blog provided some answers.&lt;br&gt;
&lt;br&gt;
&lt;pre name="code" class="c#"&gt;public void InsertCustomer( int customerId,
                          string companyName = "Neue Firma",
                          decimal creditLimit = 2000m )
{
}

InsertCustomer( 1, creditLimit: 2000m );  

InsertCustomer( creditLimit: 2000m, customerId: 1 );

&lt;/pre&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.j-maxx.net/aggbug.ashx?id=4615cd55-a3f0-4d8e-9131-f82995cf1470" /&gt;</description>
      <comments>http://blog.j-maxx.net/CommentView,guid,4615cd55-a3f0-4d8e-9131-f82995cf1470.aspx</comments>
      <category>C#</category>
      <category>C# 4.0</category>
    </item>
  </channel>
</rss>