<?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: A dollop of Lisp</title>
	<atom:link href="http://4.flowsnake.org/archives/602/feed" rel="self" type="application/rss+xml" />
	<link>http://4.flowsnake.org/archives/602</link>
	<description>A Pythoneer&#039;s adventures with Scheme, etc.</description>
	<lastBuildDate>Mon, 18 Jul 2011 14:37:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Paul hollingsworth</title>
		<link>http://4.flowsnake.org/archives/602/comment-page-1#comment-526</link>
		<dc:creator>Paul hollingsworth</dc:creator>
		<pubDate>Tue, 16 Jun 2009 04:45:58 +0000</pubDate>
		<guid isPermaLink="false">http://4.flowsnake.org/?p=602#comment-526</guid>
		<description>You can avoid mutating state by keeping two stacks:
1. the stack of &quot;things still to be done&quot; as you already have.
2. a stack of return values that have been calculated.

Your main loop repeatedly pops items off 1 until it is empty. The final result can then be popped off 2.

When evaluating a compound form you expand it by pushing a &quot;collapse&quot; task, and then &quot;expand&quot; tasks for each of the sub-expressions.

By combining the two stacks into a single immutable data structure (is use two linked lists) you can efficiently implement continuations.</description>
		<content:encoded><![CDATA[<p>You can avoid mutating state by keeping two stacks:<br />
1. the stack of &#8220;things still to be done&#8221; as you already have.<br />
2. a stack of return values that have been calculated.</p>
<p>Your main loop repeatedly pops items off 1 until it is empty. The final result can then be popped off 2.</p>
<p>When evaluating a compound form you expand it by pushing a &#8220;collapse&#8221; task, and then &#8220;expand&#8221; tasks for each of the sub-expressions.</p>
<p>By combining the two stacks into a single immutable data structure (is use two linked lists) you can efficiently implement continuations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Nowak</title>
		<link>http://4.flowsnake.org/archives/602/comment-page-1#comment-525</link>
		<dc:creator>Hans Nowak</dc:creator>
		<pubDate>Mon, 15 Jun 2009 16:02:00 +0000</pubDate>
		<guid isPermaLink="false">http://4.flowsnake.org/?p=602#comment-525</guid>
		<description>Good... I&#039;m doing *something* right then... :-)</description>
		<content:encoded><![CDATA[<p>Good&#8230; I&#8217;m doing *something* right then&#8230; :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Cowan</title>
		<link>http://4.flowsnake.org/archives/602/comment-page-1#comment-524</link>
		<dc:creator>John Cowan</dc:creator>
		<pubDate>Mon, 15 Jun 2009 14:17:08 +0000</pubDate>
		<guid isPermaLink="false">http://4.flowsnake.org/?p=602#comment-524</guid>
		<description>This, of course, is exactly how the original Scheme interpreter worked: it was embedded in Maclisp, which (like Python) provided neither tail recursion nor call/cc.</description>
		<content:encoded><![CDATA[<p>This, of course, is exactly how the original Scheme interpreter worked: it was embedded in Maclisp, which (like Python) provided neither tail recursion nor call/cc.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

