<?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: Simulating synchronous programming with Python generators</title>
	<atom:link href="http://daemons.net/~clay/2009/05/15/simulating-synchronous-programming-with-python-generators/feed/" rel="self" type="application/rss+xml" />
	<link>http://daemons.net/~clay/2009/05/15/simulating-synchronous-programming-with-python-generators/</link>
	<description>merely my musings</description>
	<lastBuildDate>Fri, 12 Mar 2010 15:34:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jonathan Aquino</title>
		<link>http://daemons.net/~clay/2009/05/15/simulating-synchronous-programming-with-python-generators/comment-page-1/#comment-95</link>
		<dc:creator>Jonathan Aquino</dc:creator>
		<pubDate>Sat, 16 May 2009 17:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://daemons.net/~clay/?p=287#comment-95</guid>
		<description>Nice 1-line description of continuations.</description>
		<content:encoded><![CDATA[<p>Nice 1-line description of continuations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: clay</title>
		<link>http://daemons.net/~clay/2009/05/15/simulating-synchronous-programming-with-python-generators/comment-page-1/#comment-93</link>
		<dc:creator>clay</dc:creator>
		<pubDate>Sat, 16 May 2009 07:27:27 +0000</pubDate>
		<guid isPermaLink="false">http://daemons.net/~clay/?p=287#comment-93</guid>
		<description>As I discovered from the nice folks in #twisted shortly after posting this, both Python and Twisted offer features that make this kind of thing much better.

First, &lt;a href=&quot;http://www.python.org/dev/peps/pep-0342/&quot; rel=&quot;nofollow&quot;&gt;Python supports first-class coroutines&lt;/a&gt;, meaning that the &lt;code&gt;yield&lt;/code&gt; statement can return a value sent by the generator&#039;s consumer.

Second, &lt;a href=&quot;http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.defer.html#inlineCallbacks&quot; rel=&quot;nofollow&quot;&gt;Twisted offers an inlineCallbacks() decorator&lt;/a&gt; that lets you return a Deferred from your generator, so that the code calling the generator can setup callbacks and errbacks as with other asynchronous code.

Alas, this is the story of my life: inventing things that are already invented :)</description>
		<content:encoded><![CDATA[<p>As I discovered from the nice folks in #twisted shortly after posting this, both Python and Twisted offer features that make this kind of thing much better.</p>
<p>First, <a href="http://www.python.org/dev/peps/pep-0342/" rel="nofollow">Python supports first-class coroutines</a>, meaning that the <code>yield</code> statement can return a value sent by the generator&#8217;s consumer.</p>
<p>Second, <a href="http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.defer.html#inlineCallbacks" rel="nofollow">Twisted offers an inlineCallbacks() decorator</a> that lets you return a Deferred from your generator, so that the code calling the generator can setup callbacks and errbacks as with other asynchronous code.</p>
<p>Alas, this is the story of my life: inventing things that are already invented <img src='http://daemons.net/~clay/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jml</title>
		<link>http://daemons.net/~clay/2009/05/15/simulating-synchronous-programming-with-python-generators/comment-page-1/#comment-92</link>
		<dc:creator>jml</dc:creator>
		<pubDate>Sat, 16 May 2009 07:02:52 +0000</pubDate>
		<guid isPermaLink="false">http://daemons.net/~clay/?p=287#comment-92</guid>
		<description>&lt;jml&gt; claymation: you know about inlineCallbacks, right?
&lt;claymation&gt; no
&lt;claymation&gt; oh boy
&lt;jml&gt; oh boy
&lt;jml&gt; indeed :)

http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.defer.html#inlineCallbacks

Well done on having the right intuition, btw. More generally, Python&#039;s continuation syntax can be used to model any system of wrapping values that follows the monad laws.</description>
		<content:encoded><![CDATA[<p>&lt;jml&gt; claymation: you know about inlineCallbacks, right?<br />
&lt;claymation&gt; no<br />
&lt;claymation&gt; oh boy<br />
&lt;jml&gt; oh boy<br />
&lt;jml&gt; indeed <img src='http://daemons.net/~clay/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.defer.html#inlineCallbacks" rel="nofollow">http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.defer.html#inlineCallbacks</a></p>
<p>Well done on having the right intuition, btw. More generally, Python&#8217;s continuation syntax can be used to model any system of wrapping values that follows the monad laws.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
