<?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: One-Line JavaScript Memoization</title>
	<atom:link href="http://ajaxian.com/archives/one-line-javascript-memoization/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/one-line-javascript-memoization</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: test</title>
		<link>http://ajaxian.com/archives/one-line-javascript-memoization/comment-page-1#comment-250575</link>
		<dc:creator>test</dc:creator>
		<pubDate>Fri, 18 May 2007 07:29:35 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2407#comment-250575</guid>
		<description>sory for this test</description>
		<content:encoded><![CDATA[<p>sory for this test</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: atany</title>
		<link>http://ajaxian.com/archives/one-line-javascript-memoization/comment-page-1#comment-250562</link>
		<dc:creator>atany</dc:creator>
		<pubDate>Thu, 17 May 2007 21:58:25 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2407#comment-250562</guid>
		<description>the shorter memoizeConstantMethod version is broken and does not work if called several times. because it references to the &#039;value&#039; variable from global scope. 

Could be easily corrected by adding &#039;var value&#039;
&lt;code&gt;
function memoizeConstantMethod(o, p) {
  var f = o[p], mf, value;
  var s = function(v) {return o[p]=v&#124;&#124;mf};
  ((mf = function() {
    (s(function(){return value})).reset = mf.reset;
    return value = f.call(this);
  }).reset = s)();
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>the shorter memoizeConstantMethod version is broken and does not work if called several times. because it references to the &#8216;value&#8217; variable from global scope. </p>
<p>Could be easily corrected by adding &#8216;var value&#8217;<br />
<code><br />
function memoizeConstantMethod(o, p) {<br />
  var f = o[p], mf, value;<br />
  var s = function(v) {return o[p]=v||mf};<br />
  ((mf = function() {<br />
    (s(function(){return value})).reset = mf.reset;<br />
    return value = f.call(this);<br />
  }).reset = s)();<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iknowright</title>
		<link>http://ajaxian.com/archives/one-line-javascript-memoization/comment-page-1#comment-250547</link>
		<dc:creator>iknowright</dc:creator>
		<pubDate>Thu, 17 May 2007 13:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2407#comment-250547</guid>
		<description>his blog spells it out though, with loads of examples... great work!</description>
		<content:encoded><![CDATA[<p>his blog spells it out though, with loads of examples&#8230; great work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iknowright</title>
		<link>http://ajaxian.com/archives/one-line-javascript-memoization/comment-page-1#comment-250546</link>
		<dc:creator>iknowright</dc:creator>
		<pubDate>Thu, 17 May 2007 13:35:36 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2407#comment-250546</guid>
		<description>I know I was just about to say. It annoys the piss out of me when I can&#039;t read the users code. I mean why share it when you do stuff like that.</description>
		<content:encoded><![CDATA[<p>I know I was just about to say. It annoys the piss out of me when I can&#8217;t read the users code. I mean why share it when you do stuff like that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tony</title>
		<link>http://ajaxian.com/archives/one-line-javascript-memoization/comment-page-1#comment-250544</link>
		<dc:creator>tony</dc:creator>
		<pubDate>Thu, 17 May 2007 13:19:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2407#comment-250544</guid>
		<description>f, mf, s, v and o with p. Great obfuscation! :D</description>
		<content:encoded><![CDATA[<p>f, mf, s, v and o with p. Great obfuscation! :D</p>
]]></content:encoded>
	</item>
</channel>
</rss>

