<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=Chain</id>
		<title>Chain - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=Chain"/>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Chain&amp;action=history"/>
		<updated>2026-09-26T19:59:17Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=Chain&amp;diff=1148&amp;oldid=prev</id>
		<title>Ximan: /* Description */</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Chain&amp;diff=1148&amp;oldid=prev"/>
				<updated>2010-12-19T00:01:11Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Description&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 00:01, 19 December 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l51&quot; &gt;Line 51:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 51:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Calling chain returns a chain closure with two defined methods, [[chain.dispose|dispose]] and [[chain.initiate|initiate]].&amp;#160; The first argument, a, is the monitoring function, and the remaining functions (or a table of functions) make up the body of the execution chain. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Calling chain returns a chain closure with two defined methods, [[chain.dispose|dispose]] and [[chain.initiate|initiate]].&amp;#160; The first argument, a, is the monitoring function, and the remaining functions (or a table of functions) make up the body of the execution chain. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Functions &lt;/del&gt;passed as the b arguments to chain are called in turn and their results are passed to the a function.&amp;#160; If a returns true, the next argument in the chain is executed.&amp;#160; See the [[chain.initiate|initiate]] method for more details.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Upon initialization, functions &lt;/ins&gt;passed as the b arguments to chain are called in turn and their results are passed to the a function.&amp;#160; If a returns true, the next argument in the chain is executed.&amp;#160; See the [[chain.initiate|initiate]] method for more details.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Upon Error ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Upon Error ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ximan</name></author>	</entry>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=Chain&amp;diff=1144&amp;oldid=prev</id>
		<title>Ximan: /* Description */</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Chain&amp;diff=1144&amp;oldid=prev"/>
				<updated>2010-12-18T23:40:52Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Description&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 23:40, 18 December 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l51&quot; &gt;Line 51:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 51:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Calling chain returns a chain closure with two defined methods, [[chain.dispose|dispose]] and [[chain.initiate|initiate]].&amp;#160; The first argument, a, is the monitoring function, and the remaining functions (or a table of functions) make up the body of the execution chain. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Calling chain returns a chain closure with two defined methods, [[chain.dispose|dispose]] and [[chain.initiate|initiate]].&amp;#160; The first argument, a, is the monitoring function, and the remaining functions (or a table of functions) make up the body of the execution chain. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Functions passed as the b arguments to chain are called in turn and their results are passed to the a function.&amp;#160; If a returns true, the next argument in the chain is executed. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Functions passed as the b arguments to chain are called in turn and their results are passed to the a function.&amp;#160; If a returns true, the next argument in the chain is executed&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&amp;#160; See the [[chain.initiate|initiate]] method for more details&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Upon Error ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Upon Error ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ximan</name></author>	</entry>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=Chain&amp;diff=1143&amp;oldid=prev</id>
		<title>Ximan: Created page with &quot;== Calling Pattern == Call  local c = sl.chain(a,b[,...]) Args  a is a function  b1..bN are functions Results  c is a chain closure  == Alternative Calling Pattern == Call  local...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Chain&amp;diff=1143&amp;oldid=prev"/>
				<updated>2010-12-18T23:39:17Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Calling Pattern == Call  local c = sl.chain(a,b[,...]) Args  a is a function  b1..bN are functions Results  c is a chain closure  == Alternative Calling Pattern == Call  local...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Calling Pattern ==&lt;br /&gt;
Call&lt;br /&gt;
 local c = sl.chain(a,b[,...])&lt;br /&gt;
Args&lt;br /&gt;
 a is a function&lt;br /&gt;
 b1..bN are functions&lt;br /&gt;
Results&lt;br /&gt;
 c is a chain closure&lt;br /&gt;
&lt;br /&gt;
== Alternative Calling Pattern ==&lt;br /&gt;
Call&lt;br /&gt;
 local c = sl.chain(a,t)&lt;br /&gt;
Args&lt;br /&gt;
 a is a function&lt;br /&gt;
 t is a table of functions with one-based, contiguous numeric keys&lt;br /&gt;
Results&lt;br /&gt;
 c is a chain closure&lt;br /&gt;
&lt;br /&gt;
== Closure Methods ==&lt;br /&gt;
&lt;br /&gt;
* [[chain.dispose]]&lt;br /&gt;
* [[chain.initiate]]&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
 local b01 = function(n,a,b,c)&lt;br /&gt;
  print(n)&lt;br /&gt;
  return true&lt;br /&gt;
 end&lt;br /&gt;
 local b02 = function(a,b,c)&lt;br /&gt;
  print(a..' '..b..' '..c)&lt;br /&gt;
  return string.char(string.byte(a)+1), string.char(string.byte(b)+1), string.char(string.byte(c)+1)&lt;br /&gt;
 end&lt;br /&gt;
 local b05 = {b02,b02,b02}&lt;br /&gt;
 local b00 = sl.chain(b01,b05)&lt;br /&gt;
 local b03, b04 = b00.init('a','b','c')&lt;br /&gt;
 print(b03)&lt;br /&gt;
 print(b04)&lt;br /&gt;
 b00.dispose()&lt;br /&gt;
&lt;br /&gt;
 --&amp;gt; a b c&lt;br /&gt;
     1&lt;br /&gt;
     b c d&lt;br /&gt;
     2&lt;br /&gt;
     c d e&lt;br /&gt;
     3&lt;br /&gt;
     3&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
Calling chain returns a chain closure with two defined methods, [[chain.dispose|dispose]] and [[chain.initiate|initiate]].  The first argument, a, is the monitoring function, and the remaining functions (or a table of functions) make up the body of the execution chain. &lt;br /&gt;
&lt;br /&gt;
Functions passed as the b arguments to chain are called in turn and their results are passed to the a function.  If a returns true, the next argument in the chain is executed. &lt;br /&gt;
&lt;br /&gt;
== Upon Error ==&lt;br /&gt;
&lt;br /&gt;
If none of the described argument patterns are matched, an error is reported and handled according to the operant error redirection mode.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib]&lt;br /&gt;
&lt;br /&gt;
* [[case]]&lt;br /&gt;
* [[iterator]]&lt;br /&gt;
* [[machine]]&lt;br /&gt;
* [[spin]]&lt;/div&gt;</summary>
		<author><name>Ximan</name></author>	</entry>

	</feed>