{"id":4037,"date":"2014-03-30T07:19:57","date_gmt":"2014-03-30T07:19:57","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/will-the-dynamic-keyword-in-c4-support-extension-methods-collection-of-common-programming-errors\/"},"modified":"2014-03-30T07:19:57","modified_gmt":"2014-03-30T07:19:57","slug":"will-the-dynamic-keyword-in-c4-support-extension-methods-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/will-the-dynamic-keyword-in-c4-support-extension-methods-collection-of-common-programming-errors\/","title":{"rendered":"Will the dynamic keyword in C#4 support extension methods?-Collection of common programming errors"},"content":{"rendered":"<p>This works which I find interesting at least&#8230;<\/p>\n<pre><code>public static class StrExtension\n{\n   public static string twice(this string str) { return str + str; }\n}\n\n...\ndynamic x = \"Yo\";\nStrExtension.twice(x);\n<\/code><\/pre>\n<p>Still, if the compiler can find the correct extension method at compile time then I don&#8217;t see why it can&#8217;t package up a set of extension methods to be looked up at runtime? It would be like a v-table for non-member methods.<\/p>\n<p>EDIT:<\/p>\n<p>This is cool&#8230; http:\/\/www2.research.att.com\/~bs\/multimethods.pdf<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This works which I find interesting at least&#8230; public static class StrExtension { public static string twice(this string str) { return str + str; } } &#8230; dynamic x = &#8220;Yo&#8221;; StrExtension.twice(x); Still, if the compiler can find the correct extension method at compile time then I don&#8217;t see why it can&#8217;t package up a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4037","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4037"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4037\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}