<?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"
	>
<channel>
	<title>Comments on: Implementing Memoize in Delphi 2009</title>
	<atom:link href="http://blogs.teamb.com/craigstuntz/2008/10/01/37839/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.teamb.com/craigstuntz/2008/10/01/37839/</link>
	<description>C# • Delphi • Entity Framework • Functional Programming • InterBase • MVC • .NET • Web</description>
	<pubDate>Fri, 12 Mar 2010 19:01:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Craig Stuntz&#8217;s Weblog : My CodeRage Presentation: Functional Programming in Delphi 2009</title>
		<link>http://blogs.teamb.com/craigstuntz/2008/10/01/37839/#comment-4081</link>
		<dc:creator>Craig Stuntz&#8217;s Weblog : My CodeRage Presentation: Functional Programming in Delphi 2009</dc:creator>
		<pubDate>Tue, 04 Nov 2008 20:23:10 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/2008/10/01/37839#comment-4081</guid>
		<description>[...] you&#8217;ve been following my blog over the past few months, you might have a fair idea of what to expect.  As you can tell from the somewhat vague abstract, I&#8217;m still rounding out the details of [...]</description>
		<content:encoded><![CDATA[<p>[...] you&#8217;ve been following my blog over the past few months, you might have a fair idea of what to expect.  As you can tell from the somewhat vague abstract, I&#8217;m still rounding out the details of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Stuntz</title>
		<link>http://blogs.teamb.com/craigstuntz/2008/10/01/37839/#comment-3950</link>
		<dc:creator>Craig Stuntz</dc:creator>
		<pubDate>Fri, 03 Oct 2008 12:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/2008/10/01/37839#comment-3950</guid>
		<description>Thanks, Allen, Prapin, and Kryvich. Kryvich, I think that would work. I haven't tested to make sure the "inner" Result doesn't get confused with the outer Result, but it's a bug if your version doesn't work, IMHO.</description>
		<content:encoded><![CDATA[<p>Thanks, Allen, Prapin, and Kryvich. Kryvich, I think that would work. I haven&#8217;t tested to make sure the "inner" Result doesn&#8217;t get confused with the outer Result, but it&#8217;s a bug if your version doesn&#8217;t work, IMHO.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kryvich</title>
		<link>http://blogs.teamb.com/craigstuntz/2008/10/01/37839/#comment-3947</link>
		<dc:creator>Kryvich</dc:creator>
		<pubDate>Fri, 03 Oct 2008 06:12:02 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/2008/10/01/37839#comment-3947</guid>
		<description>I like it too! :)

Just 1 question. Is it possible to write it as below:

Result := function(arg: A): R
begin
  if not Map.TryGetValue(arg, Result) then begin
    Result := AFunc(arg);
    Map.Add(arg, Result);
  end;
end;

It's a rather shorter.</description>
		<content:encoded><![CDATA[<p>I like it too! <img src='http://blogs.teamb.com/craigstuntz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Just 1 question. Is it possible to write it as below:</p>
<p>Result := function(arg: A): R<br />
begin<br />
  if not Map.TryGetValue(arg, Result) then begin<br />
    Result := AFunc(arg);<br />
    Map.Add(arg, Result);<br />
  end;<br />
end;</p>
<p>It&#8217;s a rather shorter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prapin</title>
		<link>http://blogs.teamb.com/craigstuntz/2008/10/01/37839/#comment-3941</link>
		<dc:creator>Prapin</dc:creator>
		<pubDate>Thu, 02 Oct 2008 01:25:48 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/2008/10/01/37839#comment-3941</guid>
		<description>Cool!</description>
		<content:encoded><![CDATA[<p>Cool!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allen Bauer</title>
		<link>http://blogs.teamb.com/craigstuntz/2008/10/01/37839/#comment-3939</link>
		<dc:creator>Allen Bauer</dc:creator>
		<pubDate>Wed, 01 Oct 2008 19:48:40 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/2008/10/01/37839#comment-3939</guid>
		<description>This is excellent. Yet another really cool use for anonymous methods! Another minor optimization you can do is to add the "static" directive to your generic class method. That will remove the implicit "Self" parameter to the function since it is clearly not needed. (Self in the case of a class method is a reference to the class *type*). By adding "static" it makes the method merely a scoped global procedure or function.

This will remove the added (I know, it's very, very minor) overhead of the MOV EAX, for the call to TMemoize.Memoize(). Since your goal was a performance boost, might as well grab all you can :-).

Allen.</description>
		<content:encoded><![CDATA[<p>This is excellent. Yet another really cool use for anonymous methods! Another minor optimization you can do is to add the "static" directive to your generic class method. That will remove the implicit "Self" parameter to the function since it is clearly not needed. (Self in the case of a class method is a reference to the class *type*). By adding "static" it makes the method merely a scoped global procedure or function.</p>
<p>This will remove the added (I know, it&#8217;s very, very minor) overhead of the MOV EAX, for the call to TMemoize.Memoize(). Since your goal was a performance boost, might as well grab all you can :-).</p>
<p>Allen.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
