<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Lambda Expressions vs. Anonymous Methods, Part Five</title><link>http://blogs.msdn.com/b/ericlippert/archive/2007/03/28/lambda-expressions-vs-anonymous-methods-part-five.aspx</link><description>Last time I demonstrated that the compiler could have to do an exponential number of bindings in order to determine whether there was a unique best overload resolution for a function call that takes a lambda. Some of you may have wondered whether we simply</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Lambda Expressions vs. Anonymous Methods, Part Five</title><link>http://blogs.msdn.com/b/ericlippert/archive/2007/03/28/lambda-expressions-vs-anonymous-methods-part-five.aspx#4084100</link><pubDate>Fri, 27 Jul 2007 21:18:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4084100</guid><dc:creator>Eric Lippert</dc:creator><description>&lt;p&gt;Whoops, you are right. &amp;nbsp;My bad. &lt;/p&gt;
&lt;p&gt;In fact, we can trivially extend this to an NP-complete problem by simply adding eight more:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; static T Or(T a1, T a2, T a3){return new T();}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; static T Or(T a1, F a2, T a3){return new T();}&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; static F Or(F a1, F a2, F a3){return new F();}&lt;/p&gt;
&lt;p&gt;Because that makes the problem into 3-SAT, which is NP-complete.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4084100" width="1" height="1"&gt;</description></item><item><title>re: Lambda Expressions vs. Anonymous Methods, Part Five</title><link>http://blogs.msdn.com/b/ericlippert/archive/2007/03/28/lambda-expressions-vs-anonymous-methods-part-five.aspx#4073215</link><pubDate>Fri, 27 Jul 2007 04:33:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4073215</guid><dc:creator>John Smith</dc:creator><description>&lt;p&gt;Awesome example!&lt;/p&gt;
&lt;p&gt;I would just like to note that you have shown the 2-SAT problem which is actually in P. But since it's trivially extended to be N-SAT if you have And(x0,x1,...xn-1) and Or(x0,x1,...xn-1) functions I'll buy it.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4073215" width="1" height="1"&gt;</description></item><item><title>re: Lambda Expressions vs. Anonymous Methods, Part Five</title><link>http://blogs.msdn.com/b/ericlippert/archive/2007/03/28/lambda-expressions-vs-anonymous-methods-part-five.aspx#3003522</link><pubDate>Thu, 31 May 2007 10:45:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3003522</guid><dc:creator>Tanveer Badar</dc:creator><description>&lt;p&gt;'Apparently in Haskell you can encode a Turing machine into the type system and make the compiler run it!'&lt;/p&gt;
&lt;p&gt;Same thing goes for C++ templates. They are Turing complete too. The reason behind template meta-programming in C++. I suppose any language with similar inferencing abilities and compiler able to make decision which type makes the best candidate if any will suffer similar problems.&lt;/p&gt;
&lt;p&gt;Partial specialization makes life a living hell for C++ compiler writers. One reason VC++ team never got partial specialization right before VC++ 2003.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3003522" width="1" height="1"&gt;</description></item><item><title>re: Lambda Expressions vs. Anonymous Methods, Part Five</title><link>http://blogs.msdn.com/b/ericlippert/archive/2007/03/28/lambda-expressions-vs-anonymous-methods-part-five.aspx#1979301</link><pubDate>Wed, 28 Mar 2007 21:37:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1979301</guid><dc:creator>Clintp</dc:creator><description>&lt;p&gt;I thought it was going to be the Halting Problem as well.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1979301" width="1" height="1"&gt;</description></item><item><title>re: Lambda Expressions vs. Anonymous Methods, Part Five</title><link>http://blogs.msdn.com/b/ericlippert/archive/2007/03/28/lambda-expressions-vs-anonymous-methods-part-five.aspx#1978908</link><pubDate>Wed, 28 Mar 2007 21:03:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1978908</guid><dc:creator>Eric Lippert</dc:creator><description>&lt;p&gt;I am pretty sure that overload resolution is decidable in a finite amount of time! It's not THAT bad.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1978908" width="1" height="1"&gt;</description></item><item><title>re: Lambda Expressions vs. Anonymous Methods, Part Five</title><link>http://blogs.msdn.com/b/ericlippert/archive/2007/03/28/lambda-expressions-vs-anonymous-methods-part-five.aspx#1978833</link><pubDate>Wed, 28 Mar 2007 20:53:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1978833</guid><dc:creator>Rob</dc:creator><description>&lt;p&gt;And here I thought your example was going to show the Halting Problem.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1978833" width="1" height="1"&gt;</description></item></channel></rss>