<?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: Self-&#8221;partially applying&#8221; JavaScript functions</title>
	<atom:link href="http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/</link>
	<description>work smarter when building current web trends</description>
	<lastBuildDate>Wed, 23 Nov 2011 11:48:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Barklund</title>
		<link>http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/comment-page-1/#comment-11315</link>
		<dc:creator>Barklund</dc:creator>
		<pubDate>Thu, 07 Feb 2008 08:42:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/#comment-11315</guid>
		<description>Hi James,

I&#039;ve fixed the typo, and regarding your comment on &quot;to leak or not&quot;, I have come to the habit of never using the activation object for variables that need be accessed inside inner functions. In this case, neither &lt;code&gt;f&lt;/code&gt; nor &lt;code&gt;n&lt;/code&gt; can be DOM objects agreed (as they are &lt;em&gt;supposed&lt;/em&gt; to be a function and an integer respectively), but if I for the fun of it (and for the errors it will throw) invoke it with &lt;code&gt;n&lt;/code&gt; set to some DOM object, that I remove from the DOM afterwards, we might get a leak quite easily (not tested though).

Thus I have come to the habit of never using the activation object in such smaller helper functions, that are generalized to work on just about anything.</description>
		<content:encoded><![CDATA[<p>Hi James,</p>
<p>I&#8217;ve fixed the typo, and regarding your comment on &#8220;to leak or not&#8221;, I have come to the habit of never using the activation object for variables that need be accessed inside inner functions. In this case, neither <code>f</code> nor <code>n</code> can be DOM objects agreed (as they are <em>supposed</em> to be a function and an integer respectively), but if I for the fun of it (and for the errors it will throw) invoke it with <code>n</code> set to some DOM object, that I remove from the DOM afterwards, we might get a leak quite easily (not tested though).</p>
<p>Thus I have come to the habit of never using the activation object in such smaller helper functions, that are generalized to work on just about anything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Coglan</title>
		<link>http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/comment-page-1/#comment-11242</link>
		<dc:creator>James Coglan</dc:creator>
		<pubDate>Wed, 06 Feb 2008 23:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/#comment-11242</guid>
		<description>Sorry, just realised my comment was ambiguous. By &quot;This has nothing to do with the DOM&quot;, I meant that partial function application (not memory leaks) has nothing to do with the DOM.</description>
		<content:encoded><![CDATA[<p>Sorry, just realised my comment was ambiguous. By &#8220;This has nothing to do with the DOM&#8221;, I meant that partial function application (not memory leaks) has nothing to do with the DOM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Coglan</title>
		<link>http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/comment-page-1/#comment-11240</link>
		<dc:creator>James Coglan</dc:creator>
		<pubDate>Wed, 06 Feb 2008 23:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/#comment-11240</guid>
		<description>Quick typo fix: in your Prototype example, you need to call c.curry.apply() rather than method.curry.apply(), since &#039;method&#039; is not defined in your version of my code. 

Interesting to see different approaches. I won&#039;t get into a debate about global functions, but I should point out that use of closures do not cause memory leaks. Memory leaks tend to be caused by circular references between JavaScript objects and DOM objects -- closures can make such references hard to spot, but they do not cause the leaks. This has nothing to do with the DOM, in fact I&#039;ve just been running my method millions of times through Drip and it shows constant memory usage.</description>
		<content:encoded><![CDATA[<p>Quick typo fix: in your Prototype example, you need to call c.curry.apply() rather than method.curry.apply(), since &#8216;method&#8217; is not defined in your version of my code. </p>
<p>Interesting to see different approaches. I won&#8217;t get into a debate about global functions, but I should point out that use of closures do not cause memory leaks. Memory leaks tend to be caused by circular references between JavaScript objects and DOM objects &#8212; closures can make such references hard to spot, but they do not cause the leaks. This has nothing to do with the DOM, in fact I&#8217;ve just been running my method millions of times through Drip and it shows constant memory usage.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
