<div class="gmail_quote">On Mon, Dec 7, 2009 at 10:02 AM, <a href="mailto:ssteinerX@gmail.com">ssteinerX@gmail.com</a> <span dir="ltr">&lt;<a href="mailto:ssteinerx@gmail.com">ssteinerx@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Dec 7, 2009, at 9:50 AM, Konrads Smelkovs wrote:<br>
<br>
&gt; Hi,<br>
&gt;<br>
&gt; One project I had a look at had this nice syntactic sugar for async function chaining:<br>
&gt;<br>
&gt; &gt;&gt;&gt; event_one() | event_two() | event_three()<br>
&gt;<br>
&gt; I think this could be an interesting alternative to addCallback or yield. I propose the following syntax<br>
&gt;<br>
&gt; # get deferred with one () and two () chained as callbacks, equivalent to d=Deferred().addCallback(one).addCallback(two)<br>
&gt; &gt;&gt;&gt; d = Deferred() | one | two<br>
&gt;<br>
&gt; # Equivalent to d=Deferred().addCallback(one).addErrback(two)<br>
&gt; &gt;&gt;&gt; d = Deferred() | one ^ two<br>
&gt;<br>
&gt; and finally:<br>
&gt; # d=Deferred().addBoth(one,two)<br>
&gt; &gt;&gt;&gt; d = Deferred() &amp; (one,two)<br>
<br>
</div>Yuck.<br>
<br>
S<br>
<br><br></blockquote><div>I&#39;d have to agree with this. Yield with inline callbacks is certainly enough syntactic sugar for me. </div></div><br>