<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: The Forgotten Delegate&#8230;</title>
	<link>http://lostintangent.com/2008/07/08/the-forgotten-delegate/</link>
	<description>Code is never finished, only abandoned...</description>
	<pubDate>Wed, 07 Jan 2009 01:41:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Josh Reuben</title>
		<link>http://lostintangent.com/2008/07/08/the-forgotten-delegate/#comment-564</link>
		<dc:creator>Josh Reuben</dc:creator>
		<pubDate>Wed, 09 Jul 2008 06:20:11 +0000</pubDate>
		<guid>http://lostintangent.com/2008/07/08/the-forgotten-delegate/#comment-564</guid>
		<description>too bad that void is not a first class citizen - otherwise you wouldnt need Action , you could just pass Funct</description>
		<content:encoded><![CDATA[<p>too bad that void is not a first class citizen - otherwise you wouldnt need Action , you could just pass Funct</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Carter</title>
		<link>http://lostintangent.com/2008/07/08/the-forgotten-delegate/#comment-556</link>
		<dc:creator>Jonathan Carter</dc:creator>
		<pubDate>Tue, 08 Jul 2008 18:24:39 +0000</pubDate>
		<guid>http://lostintangent.com/2008/07/08/the-forgotten-delegate/#comment-556</guid>
		<description>@Alex

That's a good point, and just to clarify I was referring only to code that I'm developing from scratch. If an API you're using requires a Func, then you have no choice. 

LINQ uses Funcs because they're very generic, which is exactly what you'd want in this case. A Func&lt;T, TResult&gt; is only equivalent to a Predicate&lt;T&gt; if TResult is a boolean, which leaves many other scenarios that merit the use of a Func&lt;T, TResult&gt;.

With that said, I'm not really sure why some of the standard query operators in LINQ use Func&lt;T, bool&gt; instead of Predicate (i.e SkipWhile, TakeWhile, Where). I'd imagine it's for consistency sake, since Funcs are leveraged throughout.

-Jonathan</description>
		<content:encoded><![CDATA[<p>@Alex</p>
<p>That&#8217;s a good point, and just to clarify I was referring only to code that I&#8217;m developing from scratch. If an API you&#8217;re using requires a Func, then you have no choice. </p>
<p>LINQ uses Funcs because they&#8217;re very generic, which is exactly what you&#8217;d want in this case. A Func<t , TResult> is only equivalent to a Predicate</t><t> if TResult is a boolean, which leaves many other scenarios that merit the use of a Func</t><t , TResult>.</p>
<p>With that said, I&#8217;m not really sure why some of the standard query operators in LINQ use Func</t><t , bool> instead of Predicate (i.e SkipWhile, TakeWhile, Where). I&#8217;d imagine it&#8217;s for consistency sake, since Funcs are leveraged throughout.</p>
<p>-Jonathan</t></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Simkin</title>
		<link>http://lostintangent.com/2008/07/08/the-forgotten-delegate/#comment-553</link>
		<dc:creator>Alex Simkin</dc:creator>
		<pubDate>Tue, 08 Jul 2008 13:48:15 +0000</pubDate>
		<guid>http://lostintangent.com/2008/07/08/the-forgotten-delegate/#comment-553</guid>
		<description>The reason why I do not use Predicate is that Linq doesn't use it, so the following won't compile:

Predicate IsPreferred;
Customer c = customers.Where(IsPreferred).SingleOrDefault();

"Where" expects Func and there is no way to convert one delegate to the other.</description>
		<content:encoded><![CDATA[<p>The reason why I do not use Predicate is that Linq doesn&#8217;t use it, so the following won&#8217;t compile:</p>
<p>Predicate IsPreferred;<br />
Customer c = customers.Where(IsPreferred).SingleOrDefault();</p>
<p>&#8220;Where&#8221; expects Func and there is no way to convert one delegate to the other.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ASP.NET MVC Archived Blog Posts, Page 1</title>
		<link>http://lostintangent.com/2008/07/08/the-forgotten-delegate/#comment-552</link>
		<dc:creator>ASP.NET MVC Archived Blog Posts, Page 1</dc:creator>
		<pubDate>Tue, 08 Jul 2008 12:47:49 +0000</pubDate>
		<guid>http://lostintangent.com/2008/07/08/the-forgotten-delegate/#comment-552</guid>
		<description>[...] The Forgotten Delegate… (7/8/2008)Tuesday, July 08, 2008 from lostintangent.comLast week I was doing some pair programming with Jason Olson and we were looking over a project I’m working on in connection with ASP.NET MVC and [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] The Forgotten Delegate… (7/8/2008)Tuesday, July 08, 2008 from lostintangent.comLast week I was doing some pair programming with Jason Olson and we were looking over a project I’m working on in connection with ASP.NET MVC and [&#8230;]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
