<?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>Psychic Debugging, Part Two</title><link>http://blogs.msdn.com/ericlippert/archive/2007/09/06/psychic-debugging-part-two.aspx</link><description>A number of readers have the mysterious fifth sense which gives them the ability to deduce that the GetBars method from yesterday's post contains a yield return and is therefore an iterator. Remember, as the standard states (in section 10.14.4): [...]</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Psychic Debugging, Part Two</title><link>http://blogs.msdn.com/ericlippert/archive/2007/09/06/psychic-debugging-part-two.aspx#4790546</link><pubDate>Thu, 06 Sep 2007 20:46:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4790546</guid><dc:creator>Michael Giagnocavo</dc:creator><description>&lt;p&gt;Yes, please do go into that. Especially how they interact with variable capture and so on. It's not too hard to be a bit careless and accidentally return an iterator that only works once, for instance.&lt;/p&gt;
</description></item><item><title>re: Psychic Debugging, Part Two</title><link>http://blogs.msdn.com/ericlippert/archive/2007/09/06/psychic-debugging-part-two.aspx#4794453</link><pubDate>Fri, 07 Sep 2007 00:36:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4794453</guid><dc:creator>Alex James</dc:creator><description>&lt;p&gt;Eric&lt;/p&gt;
&lt;p&gt;I understand the point you are making...&lt;/p&gt;
&lt;p&gt;but correct me if I am wrong but there is absolutely no guarantee that the method is using yields at all...&lt;/p&gt;
&lt;p&gt;i.e.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;static public IEnumerable&amp;lt;Bar&amp;gt; GetBars(Foo foo) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (foo == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new ArgumentNullException(&amp;quot;foo&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return SomeOtherClass.GetBars(foo);&lt;/p&gt;
&lt;p&gt;I which case that means that the ArgumentNullException will get fired?&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;
</description></item><item><title>re: Psychic Debugging, Part Two</title><link>http://blogs.msdn.com/ericlippert/archive/2007/09/06/psychic-debugging-part-two.aspx#4794914</link><pubDate>Fri, 07 Sep 2007 00:41:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4794914</guid><dc:creator>Eric Lippert</dc:creator><description>&lt;p&gt;Correct. &lt;/p&gt;
</description></item><item><title>re: Psychic Debugging, Part Two</title><link>http://blogs.msdn.com/ericlippert/archive/2007/09/06/psychic-debugging-part-two.aspx#4848479</link><pubDate>Mon, 10 Sep 2007 02:00:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4848479</guid><dc:creator>Dean Harding</dc:creator><description>&lt;p&gt;It'd probably be a good idea to do your parameter validation in a helper method that calls the &amp;quot;real&amp;quot; GetBars(). That way, you get the exception ASAP, rather than the first time you call MoveNext...&lt;/p&gt;
</description></item><item><title>re: Psychic Debugging, Part Two</title><link>http://blogs.msdn.com/ericlippert/archive/2007/09/06/psychic-debugging-part-two.aspx#4974245</link><pubDate>Tue, 18 Sep 2007 11:36:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4974245</guid><dc:creator>Mona</dc:creator><description>&lt;p&gt;I am working with VB.NET, I have many mathematical equations in my windows application, which differ according to many options I selected from previous form. So I m using thesse equation as strings in database and according to the selected options from the previous form it drag the its equation, which I concatinate to a variable (number) according to the selected age. So this equation doesn't work because it defined as nvchar in the databse and the variable is number, I tried the function eval() which I use in asp to solve this but it didn't work. I want to know if there is a function in VB.NET can solve this problem or what can I do to solve it.&lt;/p&gt;
</description></item><item><title>C# 4 idea: Iterator blocks and parameter checking</title><link>http://blogs.msdn.com/ericlippert/archive/2007/09/06/psychic-debugging-part-two.aspx#7992432</link><pubDate>Sun, 02 Mar 2008 22:54:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7992432</guid><dc:creator>Jon Skeet: Coding Blog</dc:creator><description>&lt;p&gt;Iterator blocks have an interesting property: they defer execution. When the method (or property) is&lt;/p&gt;
</description></item></channel></rss>