<?xml version="1.0" encoding="windows-1252"?>
<node id="734435" title="Re^9: IO::Lambda: call for participation" created="2009-01-06 08:55:39" updated="2009-01-06 08:55:39">
<type id="11">
note</type>
<author id="268515">
xdg</author>
<data>
<field name="doctext">
&lt;p&gt;How about "conditions" instead of "predicates"?  Also, at the expense of changing your API, it might be clearer if the functions names themselves were less like perl functions and more intuitively descriptive.
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;read -&gt; readable&lt;/li&gt;
&lt;li&gt;write -&gt; writeable&lt;/li&gt;
&lt;li&gt;sleep -&gt; timeout&lt;/li&gt;
&lt;li&gt;etc&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My thought is that since these aren't actually executed immediately, it would be better to have names that describe the activating condition rather than names that sound like an imperative.&lt;/p&gt;

&lt;p&gt;For documentation, I'd strongly suggest separating the perl signature from the context arguments. E.g.&lt;/p&gt;

&lt;c&gt;
read($callback) -- context stack: $filehandle, $deadline = undef
&lt;/c&gt;

&lt;div class="pmsig"&gt;&lt;div class="pmsig-268515"&gt;
&lt;p&gt;-xdg&lt;/p&gt;
&lt;p&gt;&lt;small&gt;&lt;i&gt;Code written by xdg and posted on PerlMonks is [http://creativecommons.org/licenses/publicdomain|public domain]. It is provided &lt;b&gt;as is&lt;/b&gt; with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.&lt;/i&gt;&lt;/small&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
733676</field>
<field name="parent_node">
734362</field>
</data>
</node>
