<?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: Tail Recursive Algorithms In Scala</title>
	<atom:link href="http://www.kungfuice.com/index.php/2008/09/18/tail-recursive-algorithms-in-scala/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kungfuice.com/index.php/2008/09/18/tail-recursive-algorithms-in-scala/</link>
	<description>The Ramblings Of A Programmer</description>
	<lastBuildDate>Sun, 14 Jun 2009 00:09:10 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: kungfuice</title>
		<link>http://www.kungfuice.com/index.php/2008/09/18/tail-recursive-algorithms-in-scala/comment-page-1/#comment-583</link>
		<dc:creator>kungfuice</dc:creator>
		<pubDate>Sun, 08 Feb 2009 05:05:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.kungfuice.com/?p=88#comment-583</guid>
		<description>@Amal  This is true.  Since the Java Virtual Machine has no way of optimizing tail recursive functions it is solely up to the Scala compiler to detect tail call recursive functions and reorder them into iterative functions.  Unfortunately if you do anything fancy in your tail-recursion.  Basically any function that ends in an indirect function call.  Really tail-call optimization in Scala is limited to any function that calls itself (and only itself) directly as its last operation, without going through a function value.</description>
		<content:encoded><![CDATA[<p>@Amal  This is true.  Since the Java Virtual Machine has no way of optimizing tail recursive functions it is solely up to the Scala compiler to detect tail call recursive functions and reorder them into iterative functions.  Unfortunately if you do anything fancy in your tail-recursion.  Basically any function that ends in an indirect function call.  Really tail-call optimization in Scala is limited to any function that calls itself (and only itself) directly as its last operation, without going through a function value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amal</title>
		<link>http://www.kungfuice.com/index.php/2008/09/18/tail-recursive-algorithms-in-scala/comment-page-1/#comment-581</link>
		<dc:creator>Amal</dc:creator>
		<pubDate>Fri, 23 Jan 2009 15:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.kungfuice.com/?p=88#comment-581</guid>
		<description>I am just trying to make sure that I get it right. You meant by the optimization that it can reuse the stack frame over and over, right?. But you mentioned that it does not always detect that optimization even if the program was written as tail recursive?</description>
		<content:encoded><![CDATA[<p>I am just trying to make sure that I get it right. You meant by the optimization that it can reuse the stack frame over and over, right?. But you mentioned that it does not always detect that optimization even if the program was written as tail recursive?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Allen</title>
		<link>http://www.kungfuice.com/index.php/2008/09/18/tail-recursive-algorithms-in-scala/comment-page-1/#comment-543</link>
		<dc:creator>Bill Allen</dc:creator>
		<pubDate>Fri, 26 Sep 2008 16:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kungfuice.com/?p=88#comment-543</guid>
		<description>The whole point of the tail recursion optimization is that the compiler removes the function calls effectively rewriting the algorithm to be an efficient loop.</description>
		<content:encoded><![CDATA[<p>The whole point of the tail recursion optimization is that the compiler removes the function calls effectively rewriting the algorithm to be an efficient loop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Copeland</title>
		<link>http://www.kungfuice.com/index.php/2008/09/18/tail-recursive-algorithms-in-scala/comment-page-1/#comment-542</link>
		<dc:creator>Paul Copeland</dc:creator>
		<pubDate>Fri, 26 Sep 2008 05:30:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.kungfuice.com/?p=88#comment-542</guid>
		<description>Even though there is no &quot;deferred execution&quot; there are the same number of nested function calls and presumably the same depth of the stack in the second case unless the system does some kind of rewriting.  The usual examples show that tail recursion can always be rewritten by the programmer with a loop. Many useful recursive algorithms cannot be reduced to tail recursion and there is no simple way to remove the recursion.</description>
		<content:encoded><![CDATA[<p>Even though there is no &#8220;deferred execution&#8221; there are the same number of nested function calls and presumably the same depth of the stack in the second case unless the system does some kind of rewriting.  The usual examples show that tail recursion can always be rewritten by the programmer with a loop. Many useful recursive algorithms cannot be reduced to tail recursion and there is no simple way to remove the recursion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kungfuice</title>
		<link>http://www.kungfuice.com/index.php/2008/09/18/tail-recursive-algorithms-in-scala/comment-page-1/#comment-541</link>
		<dc:creator>kungfuice</dc:creator>
		<pubDate>Fri, 26 Sep 2008 00:03:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.kungfuice.com/?p=88#comment-541</guid>
		<description>I&#039;m glad this helped you out.  Keep an eye out for some more Scala posts I&#039;ll be making in the next couple of weeks.

Chris</description>
		<content:encoded><![CDATA[<p>I&#8217;m glad this helped you out.  Keep an eye out for some more Scala posts I&#8217;ll be making in the next couple of weeks.</p>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Hodge</title>
		<link>http://www.kungfuice.com/index.php/2008/09/18/tail-recursive-algorithms-in-scala/comment-page-1/#comment-539</link>
		<dc:creator>Dan Hodge</dc:creator>
		<pubDate>Wed, 24 Sep 2008 02:58:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.kungfuice.com/?p=88#comment-539</guid>
		<description>An excellent discussion of tail recursion and much easier to follow than the section on tail recursion in Scala By Example.</description>
		<content:encoded><![CDATA[<p>An excellent discussion of tail recursion and much easier to follow than the section on tail recursion in Scala By Example.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
