<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Beware of the Lazy&lt;T&gt; .NET 4.0 type. The closure trap.</title>
	<atom:link href="http://www.whycantyoucode.com/2009/11/beware-of-the-lazyt-net-4-0-type-the-closure-trap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.whycantyoucode.com/2009/11/beware-of-the-lazyt-net-4-0-type-the-closure-trap/</link>
	<description>The highest form of ignorance is when you reject something you don&#039;t know anything about.</description>
	<lastBuildDate>Wed, 08 Sep 2010 18:34:23 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chris</title>
		<link>http://www.whycantyoucode.com/2009/11/beware-of-the-lazyt-net-4-0-type-the-closure-trap/comment-page-1/#comment-210</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 09 Jul 2010 18:19:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.whycantyoucode.com/?p=69#comment-210</guid>
		<description>Here is a way to do it that takes into consideration how the Lazy string value is assigned, using the Lambda expression.

static void Main(string[] args)
{
            List&lt;Lazy&gt; lazyInit = new List&lt;Lazy&gt;();
            char letter2 = &#039;A&#039;;
            for( int i = 0; i &lt; 26; i++)
            {
                lazyInit.Add(new Lazy(() =&gt; letter2++.ToString()));
            }

            foreach (var lazy in lazyInit)
            {
                Console.Write(lazy.Value);
            }
            Console.ReadLine();
}</description>
		<content:encoded><![CDATA[<p>Here is a way to do it that takes into consideration how the Lazy string value is assigned, using the Lambda expression.</p>
<p>static void Main(string[] args)<br />
{<br />
            List&lt;Lazy&gt; lazyInit = new List&lt;Lazy&gt;();<br />
            char letter2 = &#8216;A&#8217;;<br />
            for( int i = 0; i &lt; 26; i++)<br />
            {<br />
                lazyInit.Add(new Lazy(() =&gt; letter2++.ToString()));<br />
            }</p>
<p>            foreach (var lazy in lazyInit)<br />
            {<br />
                Console.Write(lazy.Value);<br />
            }<br />
            Console.ReadLine();<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
